1
2#define IDENT(n) __IDENT(n## _ident, #n, 0)
3#define IDENT_RESERVED(n) __IDENT(n## _ident, #n, 1)
4
5/* Basic C reserved words.. */
6IDENT_RESERVED(sizeof);
7IDENT_RESERVED(if);
8IDENT_RESERVED(else);
9IDENT_RESERVED(return);
10IDENT_RESERVED(switch);
11IDENT_RESERVED(case);
12IDENT_RESERVED(default);
13IDENT_RESERVED(break);
14IDENT_RESERVED(continue);
15IDENT_RESERVED(for);
16IDENT_RESERVED(while);
17IDENT_RESERVED(do);
18IDENT_RESERVED(goto);
19
20/* C typenames. They get marked as reserved when initialized */
21IDENT(struct);
22IDENT(union);
23IDENT(enum);
24IDENT(__attribute); IDENT(__attribute__);
25IDENT(volatile); IDENT(__volatile); IDENT(__volatile__);
26IDENT(double);
27
28/* C storage classes. They get marked as reserved when initialized */
29IDENT(static);
30
31/* C99 keywords */
32IDENT(restrict); IDENT(__restrict); IDENT(__restrict__);
33IDENT(_Bool);
34IDENT_RESERVED(_Complex);
35IDENT_RESERVED(_Imaginary);
36
37/* C11 keywords */
38IDENT(_Alignas);
39IDENT_RESERVED(_Alignof);
40IDENT(_Atomic);
41IDENT_RESERVED(_Generic);
42IDENT(_Noreturn);
43IDENT_RESERVED(_Static_assert);
44IDENT(_Thread_local);
45
46/* Special case for L'\t' */
47IDENT(L);
48
49/* Extended gcc identifiers */
50IDENT(asm); IDENT_RESERVED(__asm); IDENT_RESERVED(__asm__);
51IDENT(alignof); IDENT_RESERVED(__alignof); IDENT_RESERVED(__alignof__);
52IDENT_RESERVED(__sizeof_ptr__);
53IDENT_RESERVED(__builtin_types_compatible_p);
54IDENT_RESERVED(__builtin_offsetof);
55IDENT_RESERVED(__label__);
56
57/* Preprocessor idents.  Direct use of __IDENT avoids mentioning the keyword
58 * itself by name, preventing these tokens from expanding when compiling
59 * sparse. */
60IDENT(defined);
61IDENT(once);
62IDENT(__has_attribute);
63IDENT(__has_builtin);
64__IDENT(pragma_ident, "__pragma__", 0);
65__IDENT(_Pragma_ident, "_Pragma", 0);
66__IDENT(__VA_ARGS___ident, "__VA_ARGS__", 0);
67__IDENT(__func___ident, "__func__", 0);
68__IDENT(__FUNCTION___ident, "__FUNCTION__", 0);
69__IDENT(__PRETTY_FUNCTION___ident, "__PRETTY_FUNCTION__", 0);
70
71/* Sparse commands */
72IDENT_RESERVED(__context__);
73IDENT_RESERVED(__range__);
74
75/* Magic function names we recognize */
76IDENT(memset); IDENT(memcpy);
77IDENT(copy_to_user); IDENT(copy_from_user);
78IDENT(main);
79
80#undef __IDENT
81#undef IDENT
82#undef IDENT_RESERVED
83