diff options
author | Chris Lattner <sabre@nondot.org> | 2009-05-01 16:33:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-05-01 16:33:20 +0000 |
commit | a020b0763494e1a42261745cb3ae9c2b6da0d0a6 (patch) | |
tree | 641177e4b85b3252fd4b53a1055fad5178b1f183 /clang/lib/Parse/MinimalAction.cpp | |
parent | 6be853015815e23dbc81474407e7712f3921f913 (diff) | |
download | bcm5719-llvm-a020b0763494e1a42261745cb3ae9c2b6da0d0a6.tar.gz bcm5719-llvm-a020b0763494e1a42261745cb3ae9c2b6da0d0a6.zip |
teach -parse-noop about int128_t and friends.
llvm-svn: 70547
Diffstat (limited to 'clang/lib/Parse/MinimalAction.cpp')
-rw-r--r-- | clang/lib/Parse/MinimalAction.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/clang/lib/Parse/MinimalAction.cpp b/clang/lib/Parse/MinimalAction.cpp index fcbf4eea94e..b018e36519f 100644 --- a/clang/lib/Parse/MinimalAction.cpp +++ b/clang/lib/Parse/MinimalAction.cpp @@ -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 @@ MinimalAction::~MinimalAction() { 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 |