]> granicus.if.org Git - clang/commitdiff
Microsoft integer suffix changes:
authorFrancois Pichet <pichet2000@gmail.com>
Tue, 11 Jan 2011 11:57:53 +0000 (11:57 +0000)
committerFrancois Pichet <pichet2000@gmail.com>
Tue, 11 Jan 2011 11:57:53 +0000 (11:57 +0000)
i64 is like LL
i32 is like L

Also set isMicrosoftInteger to true only if the suffix is well formed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123230 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/LiteralSupport.cpp

index 7f4ea0e9a3a4e344e50e64f82cd46d5ceb8b1ce5..16d7b36f02efb66f026404640228934cfb116039 100644 (file)
@@ -446,22 +446,33 @@ NumericLiteralParser(const char *begin, const char *end,
               break;
             case '1':
               if (s + 2 == ThisTokEnd) break;
-              if (s[2] == '6') s += 3; // i16 suffix
+              if (s[2] == '6') {
+                s += 3; // i16 suffix
+                isMicrosoftInteger = true;
+              }
               else if (s[2] == '2') {
                 if (s + 3 == ThisTokEnd) break;
-                if (s[3] == '8') s += 4; // i128 suffix
+                if (s[3] == '8') {
+                  s += 4; // i128 suffix
+                  isMicrosoftInteger = true;
+                }
               }
-              isMicrosoftInteger = true;
               break;
             case '3':
               if (s + 2 == ThisTokEnd) break;
-              if (s[2] == '2') s += 3; // i32 suffix
-              isMicrosoftInteger = true;
+              if (s[2] == '2') {
+                s += 3; // i32 suffix
+                isLong = true;
+                isMicrosoftInteger = true;
+              }
               break;
             case '6':
               if (s + 2 == ThisTokEnd) break;
-              if (s[2] == '4') s += 3; // i64 suffix
-              isMicrosoftInteger = true;
+              if (s[2] == '4') {
+                s += 3; // i64 suffix
+                isLongLong = true;
+                isMicrosoftInteger = true;
+              }
               break;
             default:
               break;