[cfe-commits] r112490 - /cfe/trunk/lib/Lex/Lexer.cpp
Chris Lattner
sabre at nondot.org
Mon Aug 30 10:09:08 PDT 2010
Author: lattner
Date: Mon Aug 30 12:09:08 2010
New Revision: 112490
URL: http://llvm.org/viewvc/llvm-project?rev=112490&view=rev
Log:
use 'features' instead of 'PP->getLangOptions'.
Modified:
cfe/trunk/lib/Lex/Lexer.cpp
Modified: cfe/trunk/lib/Lex/Lexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Lexer.cpp?rev=112490&r1=112489&r2=112490&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/Lexer.cpp (original)
+++ cfe/trunk/lib/Lex/Lexer.cpp Mon Aug 30 12:09:08 2010
@@ -945,16 +945,16 @@
}
// If we fell out, check for a sign, due to 1e+12. If we have one, continue.
- // If we are in Microsoft mode, don't continue if the constant is hex.
- // For example, MSVC will accept the following as 3 tokens: 0x1234567e+1
- if ((C == '-' || C == '+') && (PrevCh == 'E' || PrevCh == 'e') &&
- (!PP || !PP->getLangOptions().Microsoft ||
- !isHexaLiteral(BufferPtr, CurPtr)))
- return LexNumericConstant(Result, ConsumeChar(CurPtr, Size, Result));
+ if ((C == '-' || C == '+') && (PrevCh == 'E' || PrevCh == 'e')) {
+ // If we are in Microsoft mode, don't continue if the constant is hex.
+ // For example, MSVC will accept the following as 3 tokens: 0x1234567e+1
+ if (!Features.Microsoft || !isHexaLiteral(BufferPtr, CurPtr))
+ return LexNumericConstant(Result, ConsumeChar(CurPtr, Size, Result));
+ }
// If we have a hex FP constant, continue.
if ((C == '-' || C == '+') && (PrevCh == 'P' || PrevCh == 'p') &&
- (!PP || !PP->getLangOptions().CPlusPlus0x))
+ !Features.CPlusPlus0x)
return LexNumericConstant(Result, ConsumeChar(CurPtr, Size, Result));
// Update the location of token as well as BufferPtr.
@@ -1000,7 +1000,7 @@
// FIXME: Handle UCNs
unsigned Size;
- if (PP && PP->getLangOptions().CPlusPlus0x &&
+ if (Features.CPlusPlus0x && PP &&
isIdentifierStart(getCharAndSize(CurPtr, Size))) {
Result.makeUserDefinedLiteral(ExtraDataAllocator);
Result.setFlagValue(Token::LiteralPortionClean, !Result.needsCleaning());
More information about the cfe-commits
mailing list