Deleted Added
full compact
LiteralSupport.cpp (198092) LiteralSupport.cpp (199990)
1//===--- LiteralSupport.cpp - Code to parse and process literals ----------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 361 unchanged lines hidden (view full) ---

370 isLongLong = true;
371 ++s; // Eat both of them.
372 } else {
373 isLong = true;
374 }
375 continue; // Success.
376 case 'i':
377 if (PP.getLangOptions().Microsoft) {
1//===--- LiteralSupport.cpp - Code to parse and process literals ----------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 361 unchanged lines hidden (view full) ---

370 isLongLong = true;
371 ++s; // Eat both of them.
372 } else {
373 isLong = true;
374 }
375 continue; // Success.
376 case 'i':
377 if (PP.getLangOptions().Microsoft) {
378 if (isFPConstant || isUnsigned || isLong || isLongLong) break;
379
378 // Allow i8, i16, i32, i64, and i128.
379 if (s + 1 != ThisTokEnd) {
380 switch (s[1]) {
381 case '8':
382 s += 2; // i8 suffix
383 isMicrosoftInteger = true;
380 // Allow i8, i16, i32, i64, and i128.
381 if (s + 1 != ThisTokEnd) {
382 switch (s[1]) {
383 case '8':
384 s += 2; // i8 suffix
385 isMicrosoftInteger = true;
384 continue;
386 break;
385 case '1':
387 case '1':
386 s += 2;
387 if (s == ThisTokEnd) break;
388 if (*s == '6') s++; // i16 suffix
389 else if (*s == '2') {
390 if (++s == ThisTokEnd) break;
391 if (*s == '8') s++; // i128 suffix
388 if (s + 2 == ThisTokEnd) break;
389 if (s[2] == '6') s += 3; // i16 suffix
390 else if (s[2] == '2') {
391 if (s + 3 == ThisTokEnd) break;
392 if (s[3] == '8') s += 4; // i128 suffix
392 }
393 isMicrosoftInteger = true;
393 }
394 isMicrosoftInteger = true;
394 continue;
395 break;
395 case '3':
396 case '3':
396 s += 2;
397 if (s == ThisTokEnd) break;
398 if (*s == '2') s++; // i32 suffix
397 if (s + 2 == ThisTokEnd) break;
398 if (s[2] == '2') s += 3; // i32 suffix
399 isMicrosoftInteger = true;
399 isMicrosoftInteger = true;
400 continue;
400 break;
401 case '6':
401 case '6':
402 s += 2;
403 if (s == ThisTokEnd) break;
404 if (*s == '4') s++; // i64 suffix
402 if (s + 2 == ThisTokEnd) break;
403 if (s[2] == '4') s += 3; // i64 suffix
405 isMicrosoftInteger = true;
404 isMicrosoftInteger = true;
406 continue;
407 case 'f': // FP Suffix for "float"
408 case 'F':
409 if (!isFPConstant) break; // Error for integer constant.
410 if (isFloat || isLong) break; // FF, LF invalid.
411 isFloat = true;
412 if (isImaginary) break; // Cannot be repeated.
413 PP.Diag(PP.AdvanceToTokenCharacter(TokLoc, s-begin),
414 diag::ext_imaginary_constant);
415 isImaginary = true;
416 s++;
417 continue; // Success.
405 break;
418 default:
419 break;
420 }
421 break;
422 }
423 }
424 // fall through.
425 case 'I':

--- 536 unchanged lines hidden ---
406 default:
407 break;
408 }
409 break;
410 }
411 }
412 // fall through.
413 case 'I':

--- 536 unchanged lines hidden ---