diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-07-26 09:02:26 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-07-26 09:02:26 +0000 |
commit | 5055dfcf4af806edb117eaf00fb19a3911768bba (patch) | |
tree | 42a2125e5c614221017e4b3e49d23f8095f83f6e /clang/lib/Sema/SemaExpr.cpp | |
parent | 0be6bd0f7ab12dea8943b4d45a42af621151e856 (diff) | |
download | bcm5719-llvm-5055dfcf4af806edb117eaf00fb19a3911768bba.tar.gz bcm5719-llvm-5055dfcf4af806edb117eaf00fb19a3911768bba.zip |
[MS Extensions] Remove support for the i128 integer literal suffix
There is currently no support in MSVC for using i128 as an integer
literal suffix. In fact, there appears to be no evidence that they have
ever supported this feature in any of their compilers. This was an over
generalization of their actual feature and is a nasty source of bugs.
Why is it a source of bugs? Because most code in clang expects that
evaluation of an integer constant expression won't give them something
that 'long long' can't represent. Instead of providing a meaningful
feature, i128 gives us cute ways of exploding the compiler.
llvm-svn: 243243
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 61f361676d6..12a20385a13 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -3355,13 +3355,6 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok, Scope *UDLScope) { // Get the value in the widest-possible width. unsigned MaxWidth = Context.getTargetInfo().getIntMaxTWidth(); - // The microsoft literal suffix extensions support 128-bit literals, which - // may be wider than [u]intmax_t. - // FIXME: Actually, they don't. We seem to have accidentally invented the - // i128 suffix. - if (Literal.MicrosoftInteger == 128 && MaxWidth < 128 && - Context.getTargetInfo().hasInt128Type()) - MaxWidth = 128; llvm::APInt ResultVal(MaxWidth, 0); if (Literal.GetIntegerValue(ResultVal)) { @@ -3384,12 +3377,7 @@ ExprResult Sema::ActOnNumericConstant(const Token &Tok, Scope *UDLScope) { // Microsoft specific integer suffixes are explicitly sized. if (Literal.MicrosoftInteger) { - if (Literal.MicrosoftInteger > MaxWidth) { - // If this target doesn't support __int128, error and force to ull. - Diag(Tok.getLocation(), diag::err_int128_unsupported); - Width = MaxWidth; - Ty = Context.getIntMaxType(); - } else if (Literal.MicrosoftInteger == 8 && !Literal.isUnsigned) { + if (Literal.MicrosoftInteger == 8 && !Literal.isUnsigned) { Width = 8; Ty = Context.CharTy; } else { |