diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-04-30 06:18:40 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-04-30 06:18:40 +0000 |
| commit | 7d4f5c47ce74e988dccb7114380dc3620605780f (patch) | |
| tree | 23e65b93b4b57b63164ef7e72b3c4cc5d4bd1613 /clang/lib | |
| parent | b4e27a18383b8fb041ab432a83e7e41f05f9cef1 (diff) | |
| download | bcm5719-llvm-7d4f5c47ce74e988dccb7114380dc3620605780f.tar.gz bcm5719-llvm-7d4f5c47ce74e988dccb7114380dc3620605780f.zip | |
only support int128_t on 64-bit and larger targets. 32-bit targets don't
have support for __divti3 and friends.
llvm-svn: 70480
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/Sema.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index 8ce3ce0be63..b931cf89672 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -18,6 +18,7 @@ #include "clang/AST/DeclObjC.h" #include "clang/AST/Expr.h" #include "clang/Lex/Preprocessor.h" +#include "clang/Basic/TargetInfo.h" using namespace clang; /// ConvertQualTypeToStringFn - This function is used to pretty print the @@ -109,15 +110,17 @@ void Sema::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) { TUScope = S; PushDeclContext(S, Context.getTranslationUnitDecl()); - // Install [u]int128_t. - PushOnScopeChains(TypedefDecl::Create(Context, CurContext, - SourceLocation(), - &Context.Idents.get("__int128_t"), - Context.Int128Ty), TUScope); - PushOnScopeChains(TypedefDecl::Create(Context, CurContext, - SourceLocation(), - &Context.Idents.get("__uint128_t"), - Context.UnsignedInt128Ty), TUScope); + if (PP.getTargetInfo().getPointerWidth(0) >= 64) { + // Install [u]int128_t for 64-bit targets. + PushOnScopeChains(TypedefDecl::Create(Context, CurContext, + SourceLocation(), + &Context.Idents.get("__int128_t"), + Context.Int128Ty), TUScope); + PushOnScopeChains(TypedefDecl::Create(Context, CurContext, + SourceLocation(), + &Context.Idents.get("__uint128_t"), + Context.UnsignedInt128Ty), TUScope); + } if (!PP.getLangOptions().ObjC1) return; |

