diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-21 12:39:25 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-06-21 12:39:25 +0000 |
commit | f533fd477a50467a0d96293d116f4059aa806b65 (patch) | |
tree | f8671d6df2189af0e1830c382f5cb7f0d7504ef4 /lib/Lex/LiteralSupport.cpp | |
parent | d31bc8bc756b3734c79e3748627938ce25b8f30c (diff) | |
download | clang-f533fd477a50467a0d96293d116f4059aa806b65.tar.gz |
Revert "Lex: Use the correct types for MS integer suffixes"
This reverts commit r211426.
This broke the arm bots. The crash can be reproduced on X86 by running.
./bin/clang -cc1 -fsyntax-only -verify -fms-extensions ~/llvm/clang/test/Lexer/ms-extensions.c -triple arm-linux
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211434 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/LiteralSupport.cpp')
-rw-r--r-- | lib/Lex/LiteralSupport.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/Lex/LiteralSupport.cpp b/lib/Lex/LiteralSupport.cpp index c55054be30..0103450cca 100644 --- a/lib/Lex/LiteralSupport.cpp +++ b/lib/Lex/LiteralSupport.cpp @@ -522,7 +522,7 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling, isLongLong = false; isFloat = false; isImaginary = false; - MicrosoftInteger = 0; + isMicrosoftInteger = false; hadError = false; if (*s == '0') { // parse radix @@ -606,8 +606,7 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling, case 'i': case 'I': if (PP.getLangOpts().MicrosoftExt) { - if (isLong || isLongLong || MicrosoftInteger) - break; + if (isLong || isLongLong) break; // Allow i8, i16, i32, i64, and i128. if (s + 1 != ThisTokEnd) { @@ -615,20 +614,20 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling, case '8': if (isFPConstant) break; s += 2; // i8 suffix - MicrosoftInteger = 8; + isMicrosoftInteger = true; break; case '1': if (isFPConstant) break; if (s + 2 == ThisTokEnd) break; if (s[2] == '6') { s += 3; // i16 suffix - MicrosoftInteger = 16; + isMicrosoftInteger = true; } else if (s[2] == '2') { if (s + 3 == ThisTokEnd) break; if (s[3] == '8') { s += 4; // i128 suffix - MicrosoftInteger = 128; + isMicrosoftInteger = true; } } break; @@ -637,7 +636,8 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling, if (s + 2 == ThisTokEnd) break; if (s[2] == '2') { s += 3; // i32 suffix - MicrosoftInteger = 32; + isLong = true; + isMicrosoftInteger = true; } break; case '6': @@ -645,13 +645,14 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling, if (s + 2 == ThisTokEnd) break; if (s[2] == '4') { s += 3; // i64 suffix - MicrosoftInteger = 64; + isLongLong = true; + isMicrosoftInteger = true; } break; default: break; } - if (MicrosoftInteger) + if (isMicrosoftInteger) break; } } @@ -681,7 +682,7 @@ NumericLiteralParser::NumericLiteralParser(StringRef TokSpelling, isLongLong = false; isFloat = false; isImaginary = false; - MicrosoftInteger = 0; + isMicrosoftInteger = false; saw_ud_suffix = true; return; |