[cfe-commits] r70273 - in /cfe/trunk/lib: Lex/Lexer.cpp Lex/LiteralSupport.cpp Parse/ParseStmt.cpp Sema/SemaDecl.cpp

Eli Friedman eli.friedman at gmail.com
Mon Apr 27 17:51:18 PDT 2009


Author: efriedma
Date: Mon Apr 27 19:51:18 2009
New Revision: 70273

URL: http://llvm.org/viewvc/llvm-project?rev=70273&view=rev
Log:
Get rid of some useless uses of NoExtensions.  The philosophy here is 
that if we're going to print an extension warning anyway, 
there's no point to changing behavior based on NoExtensions: it will 
only make error recovery worse.

Note that this doesn't cause any behavior change because NoExtensions 
isn't used by the current front-end.  I'm still considering what to do about
the remaining use of NoExtensions in IdentifierTable.cpp.


Modified:
    cfe/trunk/lib/Lex/Lexer.cpp
    cfe/trunk/lib/Lex/LiteralSupport.cpp
    cfe/trunk/lib/Parse/ParseStmt.cpp
    cfe/trunk/lib/Sema/SemaDecl.cpp

Modified: cfe/trunk/lib/Lex/Lexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Lexer.cpp?rev=70273&r1=70272&r2=70273&view=diff

==============================================================================
--- cfe/trunk/lib/Lex/Lexer.cpp (original)
+++ cfe/trunk/lib/Lex/Lexer.cpp Mon Apr 27 19:51:18 2009
@@ -650,8 +650,7 @@
     return LexNumericConstant(Result, ConsumeChar(CurPtr, Size, Result));
 
   // If we have a hex FP constant, continue.
-  if ((C == '-' || C == '+') && (PrevCh == 'P' || PrevCh == 'p') &&
-      (Features.HexFloats || !Features.NoExtensions))
+  if ((C == '-' || C == '+') && (PrevCh == 'P' || PrevCh == 'p'))
     return LexNumericConstant(Result, ConsumeChar(CurPtr, Size, Result));
   
   // Update the location of token as well as BufferPtr.

Modified: cfe/trunk/lib/Lex/LiteralSupport.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/LiteralSupport.cpp?rev=70273&r1=70272&r2=70273&view=diff

==============================================================================
--- cfe/trunk/lib/Lex/LiteralSupport.cpp (original)
+++ cfe/trunk/lib/Lex/LiteralSupport.cpp Mon Apr 27 19:51:18 2009
@@ -132,11 +132,9 @@
     // Otherwise, these are not valid escapes.
   case '(': case '{': case '[': case '%':
     // GCC accepts these as extensions.  We warn about them as such though.
-    if (!PP.getLangOptions().NoExtensions) {
-      PP.Diag(Loc, diag::ext_nonstandard_escape)
-        << std::string()+(char)ResultChar;
-      break;
-    }
+    PP.Diag(Loc, diag::ext_nonstandard_escape)
+      << std::string()+(char)ResultChar;
+    break;
     // FALL THROUGH.
   default:
     if (isgraph(ThisTokBuf[0]))

Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=70273&r1=70272&r2=70273&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Mon Apr 27 19:51:18 2009
@@ -1017,7 +1017,7 @@
     Res = Actions.ActOnGotoStmt(GotoLoc, Tok.getLocation(),
                                 Tok.getIdentifierInfo());
     ConsumeToken();
-  } else if (Tok.is(tok::star) && !getLang().NoExtensions) {
+  } else if (Tok.is(tok::star)) {
     // GNU indirect goto extension.
     Diag(Tok, diag::ext_gnu_indirect_goto);
     SourceLocation StarLoc = ConsumeToken();

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=70273&r1=70272&r2=70273&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Mon Apr 27 19:51:18 2009
@@ -759,7 +759,6 @@
   // from the types in the prototype. GCC then keeps the types from
   // the prototype.
   if (!getLangOptions().CPlusPlus &&
-      !getLangOptions().NoExtensions &&
       Old->hasPrototype() && !New->hasPrototype() &&
       New->getType()->getAsFunctionProtoType() &&
       Old->getNumParams() == New->getNumParams()) {





More information about the cfe-commits mailing list