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 | 4d150c84514dbf15975960a3ea46bdf6b7f16a5b (patch) | |
tree | e464a5a89e66b145cf392dd4bfce8a97f3e5e8f1 /lib/Sema/Sema.cpp | |
parent | 9f246b6bca9f9070095abe6b9e3604df3a3adc67 (diff) |
only support int128_t on 64-bit and larger targets. 32-bit targets don't
have support for __divti3 and friends.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70480 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r-- | lib/Sema/Sema.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index 8ce3ce0be6..b931cf8967 100644 --- a/lib/Sema/Sema.cpp +++ b/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; |