aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/Lexer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-08-30 17:09:08 +0000
committerChris Lattner <sabre@nondot.org>2010-08-30 17:09:08 +0000
commitb2f4a20ddc281b194caa00e850ad74759e0d50ba (patch)
tree96ccb624fd93f466456f0a2957758378b6bd4c9f /lib/Lex/Lexer.cpp
parent6320064d0c60fa8683f5623881c9394fd4aa7689 (diff)
use 'features' instead of 'PP->getLangOptions'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112490 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Lexer.cpp')
-rw-r--r--lib/Lex/Lexer.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp
index 4fd35be19c..5d32c72884 100644
--- a/lib/Lex/Lexer.cpp
+++ b/lib/Lex/Lexer.cpp
@@ -945,16 +945,16 @@ void Lexer::LexNumericConstant(Token &Result, const char *CurPtr) {
}
// 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 @@ void Lexer::LexStringLiteral(Token &Result, const char *CurPtr, bool Wide) {
// 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());