diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-29 05:41:51 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-29 05:41:51 +0000 |
commit | e6a56db2e62eeaa62ec6cfaa099298ba3356b9fd (patch) | |
tree | b5aec782243f9e01bc76d555438cad53e3334ad0 /clang/lib/Sema/SemaExpr.cpp | |
parent | 6be9b25cb628f66b8c697182bcf2fd181a3784ad (diff) | |
download | bcm5719-llvm-e6a56db2e62eeaa62ec6cfaa099298ba3356b9fd.tar.gz bcm5719-llvm-e6a56db2e62eeaa62ec6cfaa099298ba3356b9fd.zip |
Reject uses of __int128 on platforms that don't support it. Also move the ugly
'getPointerWidth(0) >= 64' test to be a method on TargetInfo, ready to be
properly cleaned up.
llvm-svn: 168856
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 66beb34128e..dd1bc0b6577 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -2841,7 +2841,10 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok, Scope *UDLScope) { unsigned MaxWidth = Context.getTargetInfo().getIntMaxTWidth(); // The microsoft literal suffix extensions support 128-bit literals, which // may be wider than [u]intmax_t. - if (Literal.isMicrosoftInteger && MaxWidth < 128) + // FIXME: Actually, they don't. We seem to have accidentally invented the + // i128 suffix. + if (Literal.isMicrosoftInteger && MaxWidth < 128 && + PP.getTargetInfo().hasInt128Type()) MaxWidth = 128; llvm::APInt ResultVal(MaxWidth, 0); @@ -2911,7 +2914,8 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok, Scope *UDLScope) { // If it doesn't fit in unsigned long long, and we're using Microsoft // extensions, then its a 128-bit integer literal. - if (Ty.isNull() && Literal.isMicrosoftInteger) { + if (Ty.isNull() && Literal.isMicrosoftInteger && + PP.getTargetInfo().hasInt128Type()) { if (Literal.isUnsigned) Ty = Context.UnsignedInt128Ty; else |