Support MS-specific integer suffixes (i8, i16, i32, i64, i128).

llvm-svn: 49229
This commit is contained in:
Steve Naroff 2008-04-04 21:02:54 +00:00
parent 579a05d767
commit a1f414517c
1 changed files with 29 additions and 0 deletions

View File

@ -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':