]> granicus.if.org Git - clang/commitdiff
use 'features' instead of 'PP->getLangOptions'.
authorChris Lattner <sabre@nondot.org>
Mon, 30 Aug 2010 17:09:08 +0000 (17:09 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 30 Aug 2010 17:09:08 +0000 (17:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112490 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/Lexer.cpp

index 4fd35be19c20b8c0ad5ed71ddf6c4660d31ec213..5d32c72884f5abccb03b40fc2d6f8c3cc6416ee8 100644 (file)
@@ -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());