[cfe-commits] r70547 - /cfe/trunk/lib/Parse/MinimalAction.cpp

Chris Lattner sabre at nondot.org
Fri May 1 09:33:20 PDT 2009


Author: lattner
Date: Fri May  1 11:33:20 2009
New Revision: 70547

URL: http://llvm.org/viewvc/llvm-project?rev=70547&view=rev
Log:
teach -parse-noop about int128_t and friends.

Modified:
    cfe/trunk/lib/Parse/MinimalAction.cpp

Modified: cfe/trunk/lib/Parse/MinimalAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/MinimalAction.cpp?rev=70547&r1=70546&r2=70547&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/MinimalAction.cpp (original)
+++ cfe/trunk/lib/Parse/MinimalAction.cpp Fri May  1 11:33:20 2009
@@ -14,6 +14,7 @@
 #include "clang/Parse/Parser.h"
 #include "clang/Parse/DeclSpec.h"
 #include "clang/Parse/Scope.h"
+#include "clang/Basic/TargetInfo.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/RecyclingAllocator.h"
 #include "llvm/Support/raw_ostream.h"
@@ -100,16 +101,22 @@
 
 void MinimalAction::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
   TUScope = S;
-  if (!PP.getLangOptions().ObjC1) return;
-
 
   TypeNameInfoTable &TNIT = *getTable(TypeNameInfoTablePtr);
+
+  if (PP.getTargetInfo().getPointerWidth(0) >= 64) {
+    // Install [u]int128_t for 64-bit targets.
+    TNIT.AddEntry(true, &Idents.get("__int128_t"));
+    TNIT.AddEntry(true, &Idents.get("__uint128_t"));
+  }
   
-  // Recognize the ObjC built-in type identifiers as types. 
-  TNIT.AddEntry(true, &Idents.get("id"));
-  TNIT.AddEntry(true, &Idents.get("SEL"));
-  TNIT.AddEntry(true, &Idents.get("Class"));
-  TNIT.AddEntry(true, &Idents.get("Protocol"));
+  if (PP.getLangOptions().ObjC1) {
+    // Recognize the ObjC built-in type identifiers as types. 
+    TNIT.AddEntry(true, &Idents.get("id"));
+    TNIT.AddEntry(true, &Idents.get("SEL"));
+    TNIT.AddEntry(true, &Idents.get("Class"));
+    TNIT.AddEntry(true, &Idents.get("Protocol"));
+  }
 }
 
 /// isTypeName - This looks at the IdentifierInfo::FETokenInfo field to





More information about the cfe-commits mailing list