diff options
author | Steve Naroff <snaroff@apple.com> | 2008-04-04 21:02:54 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-04-04 21:02:54 +0000 |
commit | 0c29b22f4384500cc0d04f3072cc5d5d58d10d6c (patch) | |
tree | 2e066d51917aa37a2472fa96d7f9bf2330c90dd7 /lib/Lex/LiteralSupport.cpp | |
parent | f81557cb719dd0d1ce3713f050fb76b0a0cb729a (diff) |
Support MS-specific integer suffixes (i8, i16, i32, i64, i128).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49229 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/LiteralSupport.cpp')
-rw-r--r-- | lib/Lex/LiteralSupport.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/Lex/LiteralSupport.cpp b/lib/Lex/LiteralSupport.cpp index aa0b831af9..7d775dc855 100644 --- a/lib/Lex/LiteralSupport.cpp +++ b/lib/Lex/LiteralSupport.cpp @@ -349,6 +349,35 @@ NumericLiteralParser(const char *begin, const char *end, } 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': |