[cfe-commits] r38773 - in /cfe/cfe/trunk: Lex/Preprocessor.cpp include/clang/Basic/TokenKinds.def
sabre at cs.uiuc.edu
sabre at cs.uiuc.edu
Wed Jul 11 09:24:30 PDT 2007
Author: sabre
Date: Wed Jul 11 11:24:29 2007
New Revision: 38773
URL: http://llvm.org/viewvc/llvm-project?rev=38773&view=rev
Log:
No need for explicit underscore anymore.
Modified:
cfe/cfe/trunk/Lex/Preprocessor.cpp
cfe/cfe/trunk/include/clang/Basic/TokenKinds.def
Modified: cfe/cfe/trunk/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/Lex/Preprocessor.cpp?rev=38773&r1=38772&r2=38773&view=diff
==============================================================================
--- cfe/cfe/trunk/Lex/Preprocessor.cpp (original)
+++ cfe/cfe/trunk/Lex/Preprocessor.cpp Wed Jul 11 11:24:29 2007
@@ -120,7 +120,7 @@
// Add keywords and tokens for the current language.
#define KEYWORD(NAME, FLAGS) \
- AddKeyword(#NAME+1, tok::kw##NAME, \
+ AddKeyword(#NAME+1, tok::kw_ ## NAME, \
(FLAGS >> C90Shift) & Mask, \
(FLAGS >> C99Shift) & Mask, \
(FLAGS >> CPPShift) & Mask);
Modified: cfe/cfe/trunk/include/clang/Basic/TokenKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Basic/TokenKinds.def?rev=38773&r1=38772&r2=38773&view=diff
==============================================================================
--- cfe/cfe/trunk/include/clang/Basic/TokenKinds.def (original)
+++ cfe/cfe/trunk/include/clang/Basic/TokenKinds.def Wed Jul 11 11:24:29 2007
@@ -18,7 +18,7 @@
#define TOK(X)
#endif
#ifndef KEYWORD
-#define KEYWORD(X,Y) TOK(kw ## X)
+#define KEYWORD(X,Y) TOK(kw_ ## X)
#endif
#ifndef ALIAS
#define ALIAS(X,Y)
@@ -111,8 +111,7 @@
// at_string // @"foo"
-// C99 6.4.1: Keywords. These turn into kw_* tokens. The _ prefix is used to
-// prevent the __VA_ARGS__ token from appearing here.
+// C99 6.4.1: Keywords. These turn into kw_* tokens.
// Flags allowed:
// NOTC90 - In C90, this token is never available.
// EXTC90 - In C90, this token is an extension that is enabled unless strict.
@@ -121,97 +120,97 @@
// NOTCPP - In C++, this token is never available.
// EXTCPP - In C++, this token is an extension that is enabled unless strict.
//
-KEYWORD(_auto , 0)
-KEYWORD(_break , 0)
-KEYWORD(_case , 0)
-KEYWORD(_char , 0)
-KEYWORD(_const , 0)
-KEYWORD(_continue , 0)
-KEYWORD(_default , 0)
-KEYWORD(_do , 0)
-KEYWORD(_double , 0)
-KEYWORD(_else , 0)
-KEYWORD(_enum , 0)
-KEYWORD(_extern , 0)
-KEYWORD(_float , 0)
-KEYWORD(_for , 0)
-KEYWORD(_goto , 0)
-KEYWORD(_if , 0)
-KEYWORD(_inline , EXTC90) // Ext in C90, ok in C99/C++
-KEYWORD(_int , 0)
-KEYWORD(_long , 0)
-KEYWORD(_register , 0)
-KEYWORD(_restrict , NOTC90) // Not in C90
-KEYWORD(_return , 0)
-KEYWORD(_short , 0)
-KEYWORD(_signed , 0)
-KEYWORD(_sizeof , 0)
-KEYWORD(_static , 0)
-KEYWORD(_struct , 0)
-KEYWORD(_switch , 0)
-KEYWORD(_typedef , 0)
-KEYWORD(_union , 0)
-KEYWORD(_unsigned , 0)
-KEYWORD(_void , 0)
-KEYWORD(_volatile , 0)
-KEYWORD(_while , 0)
-KEYWORD(__Bool , NOTC90|NOTCPP) // C99 only
-KEYWORD(__Complex , NOTC90) // C99/C++
-KEYWORD(__Imaginary , NOTC90|NOTCPP) // C90 only
+KEYWORD(auto , 0)
+KEYWORD(break , 0)
+KEYWORD(case , 0)
+KEYWORD(char , 0)
+KEYWORD(const , 0)
+KEYWORD(continue , 0)
+KEYWORD(default , 0)
+KEYWORD(do , 0)
+KEYWORD(double , 0)
+KEYWORD(else , 0)
+KEYWORD(enum , 0)
+KEYWORD(extern , 0)
+KEYWORD(float , 0)
+KEYWORD(for , 0)
+KEYWORD(goto , 0)
+KEYWORD(if , 0)
+KEYWORD(inline , EXTC90) // Ext in C90, ok in C99/C++
+KEYWORD(int , 0)
+KEYWORD(long , 0)
+KEYWORD(register , 0)
+KEYWORD(restrict , NOTC90) // Not in C90
+KEYWORD(return , 0)
+KEYWORD(short , 0)
+KEYWORD(signed , 0)
+KEYWORD(sizeof , 0)
+KEYWORD(static , 0)
+KEYWORD(struct , 0)
+KEYWORD(switch , 0)
+KEYWORD(typedef , 0)
+KEYWORD(union , 0)
+KEYWORD(unsigned , 0)
+KEYWORD(void , 0)
+KEYWORD(volatile , 0)
+KEYWORD(while , 0)
+KEYWORD(_Bool , NOTC90|NOTCPP) // C99 only
+KEYWORD(_Complex , NOTC90) // C99/C++
+KEYWORD(_Imaginary , NOTC90|NOTCPP) // C90 only
// Special tokens to the compiler.
-KEYWORD(___func__ , EXTC90|EXTCPP) // Only in C99.
-KEYWORD(___FUNCTION__ , EXTC90|EXTC99|EXTCPP) // GCC Extension.
-KEYWORD(___PRETTY_FUNCTION__ , EXTC90|EXTC99|EXTCPP) // GCC Extension.
+KEYWORD(__func__ , EXTC90|EXTCPP) // Only in C99.
+KEYWORD(__FUNCTION__ , EXTC90|EXTC99|EXTCPP) // GCC Extension.
+KEYWORD(__PRETTY_FUNCTION__ , EXTC90|EXTC99|EXTCPP) // GCC Extension.
// C++
-KEYWORD(_asm , EXTC90|EXTC99) // Exts in C90/C99
-KEYWORD(_catch , NOTC90|NOTC99)
-KEYWORD(_class , NOTC90|NOTC99)
-KEYWORD(_const_cast , NOTC90|NOTC99)
-KEYWORD(_delete , NOTC90|NOTC99)
-KEYWORD(_dynamic_cast , NOTC90|NOTC99)
-KEYWORD(_explicit , NOTC90|NOTC99)
-KEYWORD(_export , NOTC90|NOTC99)
-KEYWORD(_false , NOTC90|NOTC99)
-KEYWORD(_friend , NOTC90|NOTC99)
-KEYWORD(_mutable , NOTC90|NOTC99)
-KEYWORD(_namespace , NOTC90|NOTC99)
-KEYWORD(_new , NOTC90|NOTC99)
-KEYWORD(_operator , NOTC90|NOTC99)
-KEYWORD(_private , NOTC90|NOTC99)
-KEYWORD(_protected , NOTC90|NOTC99)
-KEYWORD(_public , NOTC90|NOTC99)
-KEYWORD(_reinterpret_cast , NOTC90|NOTC99)
-KEYWORD(_static_cast , NOTC90|NOTC99)
-KEYWORD(_template , NOTC90|NOTC99)
-KEYWORD(_this , NOTC90|NOTC99)
-KEYWORD(_throw , NOTC90|NOTC99)
-KEYWORD(_true , NOTC90|NOTC99)
-KEYWORD(_try , NOTC90|NOTC99)
-KEYWORD(_typename , NOTC90|NOTC99)
-KEYWORD(_typeid , NOTC90|NOTC99)
-KEYWORD(_using , NOTC90|NOTC99)
-KEYWORD(_virtual , NOTC90|NOTC99)
-KEYWORD(_wchar_t , NOTC90|NOTC99)
+KEYWORD(asm , EXTC90|EXTC99) // Exts in C90/C99
+KEYWORD(catch , NOTC90|NOTC99)
+KEYWORD(class , NOTC90|NOTC99)
+KEYWORD(const_cast , NOTC90|NOTC99)
+KEYWORD(delete , NOTC90|NOTC99)
+KEYWORD(dynamic_cast , NOTC90|NOTC99)
+KEYWORD(explicit , NOTC90|NOTC99)
+KEYWORD(export , NOTC90|NOTC99)
+KEYWORD(false , NOTC90|NOTC99)
+KEYWORD(friend , NOTC90|NOTC99)
+KEYWORD(mutable , NOTC90|NOTC99)
+KEYWORD(namespace , NOTC90|NOTC99)
+KEYWORD(new , NOTC90|NOTC99)
+KEYWORD(operator , NOTC90|NOTC99)
+KEYWORD(private , NOTC90|NOTC99)
+KEYWORD(protected , NOTC90|NOTC99)
+KEYWORD(public , NOTC90|NOTC99)
+KEYWORD(reinterpret_cast , NOTC90|NOTC99)
+KEYWORD(static_cast , NOTC90|NOTC99)
+KEYWORD(template , NOTC90|NOTC99)
+KEYWORD(this , NOTC90|NOTC99)
+KEYWORD(throw , NOTC90|NOTC99)
+KEYWORD(true , NOTC90|NOTC99)
+KEYWORD(try , NOTC90|NOTC99)
+KEYWORD(typename , NOTC90|NOTC99)
+KEYWORD(typeid , NOTC90|NOTC99)
+KEYWORD(using , NOTC90|NOTC99)
+KEYWORD(virtual , NOTC90|NOTC99)
+KEYWORD(wchar_t , NOTC90|NOTC99)
// GNU Extensions.
-KEYWORD(__Decimal32 , EXTC90|EXTC99|EXTCPP)
-KEYWORD(__Decimal64 , EXTC90|EXTC99|EXTCPP)
-KEYWORD(__Decimal128 , EXTC90|EXTC99|EXTCPP)
-KEYWORD(_typeof , EXTC90|EXTC99|EXTCPP)
-KEYWORD(___null , NOTC90|NOTC99|EXTCPP) // C++-only Extensn
-KEYWORD(___alignof , EXTC90|EXTC99|EXTCPP)
-KEYWORD(___attribute , EXTC90|EXTC99|EXTCPP)
-KEYWORD(___builtin_choose_expr , EXTC90|EXTC99|EXTCPP)
-KEYWORD(___builtin_offsetof , EXTC90|EXTC99|EXTCPP)
-KEYWORD(___builtin_types_compatible_p, EXTC90|EXTC99|EXTCPP)
-KEYWORD(___builtin_va_arg , EXTC90|EXTC99|EXTCPP)
-KEYWORD(___extension__ , 0) // Not treated as an extension!
-KEYWORD(___imag , EXTC90|EXTC99|EXTCPP)
-KEYWORD(___label__ , EXTC90|EXTC99|EXTCPP)
-KEYWORD(___real , EXTC90|EXTC99|EXTCPP)
-KEYWORD(___thread , EXTC90|EXTC99|EXTCPP)
+KEYWORD(_Decimal32 , EXTC90|EXTC99|EXTCPP)
+KEYWORD(_Decimal64 , EXTC90|EXTC99|EXTCPP)
+KEYWORD(_Decimal128 , EXTC90|EXTC99|EXTCPP)
+KEYWORD(typeof , EXTC90|EXTC99|EXTCPP)
+KEYWORD(__null , NOTC90|NOTC99|EXTCPP) // C++-only Extensn
+KEYWORD(__alignof , EXTC90|EXTC99|EXTCPP)
+KEYWORD(__attribute , EXTC90|EXTC99|EXTCPP)
+KEYWORD(__builtin_choose_expr , EXTC90|EXTC99|EXTCPP)
+KEYWORD(__builtin_offsetof , EXTC90|EXTC99|EXTCPP)
+KEYWORD(__builtin_types_compatible_p, EXTC90|EXTC99|EXTCPP)
+KEYWORD(__builtin_va_arg , EXTC90|EXTC99|EXTCPP)
+KEYWORD(__extension__ , 0) // Not treated as an extension!
+KEYWORD(__imag , EXTC90|EXTC99|EXTCPP)
+KEYWORD(__label__ , EXTC90|EXTC99|EXTCPP)
+KEYWORD(__real , EXTC90|EXTC99|EXTCPP)
+KEYWORD(__thread , EXTC90|EXTC99|EXTCPP)
// Alternate spelling for various tokens. There are GCC extensions in all
// languages, but should not be disabled in strict conformance mode.
More information about the cfe-commits
mailing list