11f5207bJohn Levon
21f5207bJohn Levon#define IDENT(n) __IDENT(n## _ident, #n, 0)
31f5207bJohn Levon#define IDENT_RESERVED(n) __IDENT(n## _ident, #n, 1)
41f5207bJohn Levon
51f5207bJohn Levon/* Basic C reserved words.. */
61f5207bJohn LevonIDENT_RESERVED(sizeof);
71f5207bJohn LevonIDENT_RESERVED(if);
81f5207bJohn LevonIDENT_RESERVED(else);
91f5207bJohn LevonIDENT_RESERVED(return);
101f5207bJohn LevonIDENT_RESERVED(switch);
111f5207bJohn LevonIDENT_RESERVED(case);
121f5207bJohn LevonIDENT_RESERVED(default);
131f5207bJohn LevonIDENT_RESERVED(break);
141f5207bJohn LevonIDENT_RESERVED(continue);
151f5207bJohn LevonIDENT_RESERVED(for);
161f5207bJohn LevonIDENT_RESERVED(while);
171f5207bJohn LevonIDENT_RESERVED(do);
181f5207bJohn LevonIDENT_RESERVED(goto);
191f5207bJohn Levon
201f5207bJohn Levon/* C typenames. They get marked as reserved when initialized */
211f5207bJohn LevonIDENT(struct);
221f5207bJohn LevonIDENT(union);
231f5207bJohn LevonIDENT(enum);
241f5207bJohn LevonIDENT(__attribute); IDENT(__attribute__);
251f5207bJohn LevonIDENT(volatile); IDENT(__volatile); IDENT(__volatile__);
261f5207bJohn LevonIDENT(double);
271f5207bJohn Levon
281f5207bJohn Levon/* C storage classes. They get marked as reserved when initialized */
291f5207bJohn LevonIDENT(static);
301f5207bJohn Levon
311f5207bJohn Levon/* C99 keywords */
321f5207bJohn LevonIDENT(restrict); IDENT(__restrict); IDENT(__restrict__);
331f5207bJohn LevonIDENT(_Bool);
34eb44bccJohn LevonIDENT_RESERVED(_Complex);
351f5207bJohn LevonIDENT_RESERVED(_Imaginary);
361f5207bJohn Levon
371f5207bJohn Levon/* C11 keywords */
381f5207bJohn LevonIDENT(_Alignas);
391f5207bJohn LevonIDENT_RESERVED(_Alignof);
40c85f09cJohn LevonIDENT(_Atomic);
411f5207bJohn LevonIDENT_RESERVED(_Generic);
421f5207bJohn LevonIDENT(_Noreturn);
431f5207bJohn LevonIDENT_RESERVED(_Static_assert);
441f5207bJohn LevonIDENT(_Thread_local);
451f5207bJohn Levon
461f5207bJohn Levon/* Special case for L'\t' */
471f5207bJohn LevonIDENT(L);
481f5207bJohn Levon
491f5207bJohn Levon/* Extended gcc identifiers */
501f5207bJohn LevonIDENT(asm); IDENT_RESERVED(__asm); IDENT_RESERVED(__asm__);
511f5207bJohn LevonIDENT(alignof); IDENT_RESERVED(__alignof); IDENT_RESERVED(__alignof__);
521f5207bJohn LevonIDENT_RESERVED(__sizeof_ptr__);
531f5207bJohn LevonIDENT_RESERVED(__builtin_types_compatible_p);
541f5207bJohn LevonIDENT_RESERVED(__builtin_offsetof);
551f5207bJohn LevonIDENT_RESERVED(__label__);
561f5207bJohn Levon
571f5207bJohn Levon/* Preprocessor idents.  Direct use of __IDENT avoids mentioning the keyword
581f5207bJohn Levon * itself by name, preventing these tokens from expanding when compiling
591f5207bJohn Levon * sparse. */
601f5207bJohn LevonIDENT(defined);
611f5207bJohn LevonIDENT(once);
62c85f09cJohn LevonIDENT(__has_attribute);
63c85f09cJohn LevonIDENT(__has_builtin);
641f5207bJohn Levon__IDENT(pragma_ident, "__pragma__", 0);
651f5207bJohn Levon__IDENT(_Pragma_ident, "_Pragma", 0);
661f5207bJohn Levon__IDENT(__VA_ARGS___ident, "__VA_ARGS__", 0);
671f5207bJohn Levon__IDENT(__func___ident, "__func__", 0);
681f5207bJohn Levon__IDENT(__FUNCTION___ident, "__FUNCTION__", 0);
691f5207bJohn Levon__IDENT(__PRETTY_FUNCTION___ident, "__PRETTY_FUNCTION__", 0);
701f5207bJohn Levon
711f5207bJohn Levon/* Sparse commands */
721f5207bJohn LevonIDENT_RESERVED(__context__);
731f5207bJohn LevonIDENT_RESERVED(__range__);
741f5207bJohn Levon
751f5207bJohn Levon/* Magic function names we recognize */
761f5207bJohn LevonIDENT(memset); IDENT(memcpy);
771f5207bJohn LevonIDENT(copy_to_user); IDENT(copy_from_user);
781f5207bJohn LevonIDENT(main);
791f5207bJohn Levon
801f5207bJohn Levon#undef __IDENT
811f5207bJohn Levon#undef IDENT
821f5207bJohn Levon#undef IDENT_RESERVED
83