[cfe-commits] r49229 - /cfe/trunk/lib/Lex/LiteralSupport.cpp

Steve Naroff snaroff at apple.com
Fri Apr 4 14:02:55 PDT 2008


Author: snaroff
Date: Fri Apr  4 16:02:54 2008
New Revision: 49229

URL: http://llvm.org/viewvc/llvm-project?rev=49229&view=rev
Log:
Support MS-specific integer suffixes (i8, i16, i32, i64, i128).

Modified:
    cfe/trunk/lib/Lex/LiteralSupport.cpp

Modified: cfe/trunk/lib/Lex/LiteralSupport.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/LiteralSupport.cpp?rev=49229&r1=49228&r2=49229&view=diff

==============================================================================
--- cfe/trunk/lib/Lex/LiteralSupport.cpp (original)
+++ cfe/trunk/lib/Lex/LiteralSupport.cpp Fri Apr  4 16:02:54 2008
@@ -349,6 +349,35 @@
       }
       continue;  // Success.
     case 'i':
+      if (PP.getLangOptions().Microsoft) {
+        // Allow i8, i16, i32, i64, and i128.
+        if (++s == ThisTokEnd) break;
+        switch (*s) {
+          case '8': 
+            s++; // i8 suffix
+            break;
+          case '1':
+            if (++s == ThisTokEnd) break;
+            if (*s == '6') s++; // i16 suffix
+            else if (*s == '2') {
+              if (++s == ThisTokEnd) break;
+              if (*s == '8') s++; // i128 suffix
+            }
+            break;
+          case '3':
+            if (++s == ThisTokEnd) break;
+            if (*s == '2') s++; // i32 suffix
+            break;
+          case '6':
+            if (++s == ThisTokEnd) break;
+            if (*s == '4') s++; // i64 suffix
+            break;
+          default:
+            break;
+        }
+        break;
+      }
+      // fall through.
     case 'I':
     case 'j':
     case 'J':





More information about the cfe-commits mailing list