[cfe-commits] r46852 - in /cfe/trunk: Lex/Preprocessor.cpp Parse/ParseDecl.cpp include/clang/Basic/TokenKinds.def

Steve Naroff snaroff at apple.com
Thu Feb 7 07:26:07 PST 2008


Author: snaroff
Date: Thu Feb  7 09:26:07 2008
New Revision: 46852

URL: http://llvm.org/viewvc/llvm-project?rev=46852&view=rev
Log:

Minor cleanup from yesterday's -fms-extension commit. Move __int* MS keywords to predefined macros. This removes some of the MS-madness from Parser::ParseDeclarationSpecifiers().

Modified:
    cfe/trunk/Lex/Preprocessor.cpp
    cfe/trunk/Parse/ParseDecl.cpp
    cfe/trunk/include/clang/Basic/TokenKinds.def

Modified: cfe/trunk/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Lex/Preprocessor.cpp?rev=46852&r1=46851&r2=46852&view=diff

==============================================================================
--- cfe/trunk/Lex/Preprocessor.cpp (original)
+++ cfe/trunk/Lex/Preprocessor.cpp Thu Feb  7 09:26:07 2008
@@ -430,6 +430,10 @@
     DefineBuiltinMacro(Buf, "_cdecl=");
     DefineBuiltinMacro(Buf, "__ptr64=");
     DefineBuiltinMacro(Buf, "__forceinline=");
+    DefineBuiltinMacro(Buf, "__int8=char");
+    DefineBuiltinMacro(Buf, "__int16=short");
+    DefineBuiltinMacro(Buf, "__int32=int");
+    DefineBuiltinMacro(Buf, "__int64=long");
   }
   // FIXME: Should emit a #line directive here.
 }

Modified: cfe/trunk/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseDecl.cpp?rev=46852&r1=46851&r2=46852&view=diff

==============================================================================
--- cfe/trunk/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/Parse/ParseDecl.cpp Thu Feb  7 09:26:07 2008
@@ -516,11 +516,9 @@
       break;
       
     // type-specifiers
-    case tok::kw___int16:
     case tok::kw_short:
       isInvalid = DS.SetTypeSpecWidth(DeclSpec::TSW_short, Loc, PrevSpec);
       break;
-    case tok::kw___int64:
     case tok::kw_long:
       if (DS.getTypeSpecWidth() != DeclSpec::TSW_long)
         isInvalid = DS.SetTypeSpecWidth(DeclSpec::TSW_long, Loc, PrevSpec);
@@ -542,11 +540,9 @@
     case tok::kw_void:
       isInvalid = DS.SetTypeSpecType(DeclSpec::TST_void, Loc, PrevSpec);
       break;
-    case tok::kw___int8:
     case tok::kw_char:
       isInvalid = DS.SetTypeSpecType(DeclSpec::TST_char, Loc, PrevSpec);
       break;
-    case tok::kw___int32:
     case tok::kw_int:
       isInvalid = DS.SetTypeSpecType(DeclSpec::TST_int, Loc, PrevSpec);
       break;

Modified: cfe/trunk/include/clang/Basic/TokenKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TokenKinds.def?rev=46852&r1=46851&r2=46852&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/TokenKinds.def (original)
+++ cfe/trunk/include/clang/Basic/TokenKinds.def Thu Feb  7 09:26:07 2008
@@ -302,10 +302,6 @@
 // Microsoft Extensions.
 KEYWORD(__w64          , EXTC90|EXTC99|NOTCPP)
 KEYWORD(__declspec     , EXTC90|EXTC99|NOTCPP)
-KEYWORD(__int8         , EXTC90|EXTC99|NOTCPP)
-KEYWORD(__int16        , EXTC90|EXTC99|NOTCPP)
-KEYWORD(__int32        , EXTC90|EXTC99|NOTCPP)
-KEYWORD(__int64        , EXTC90|EXTC99|NOTCPP)
 
 // 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