]> granicus.if.org Git - clang/commitdiff
Get rid of some useless uses of NoExtensions. The philosophy here is
authorEli Friedman <eli.friedman@gmail.com>
Tue, 28 Apr 2009 00:51:18 +0000 (00:51 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Tue, 28 Apr 2009 00:51:18 +0000 (00:51 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70273 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/Lexer.cpp
lib/Lex/LiteralSupport.cpp
lib/Parse/ParseStmt.cpp
lib/Sema/SemaDecl.cpp

index fff6f10fa9fef680acd1b0915986e0f10d083993..3f78be68c13a587f0e8571378ca8ac77f382fd02 100644 (file)
@@ -650,8 +650,7 @@ void Lexer::LexNumericConstant(Token &Result, const char *CurPtr) {
     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.
index a3184e90ad8d1185f81f6a933c14a73ce94b23d4..03ecff91a57847a3633bfa6ed949cf38b882ec06 100644 (file)
@@ -132,11 +132,9 @@ static unsigned ProcessCharEscape(const char *&ThisTokBuf,
     // 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]))
index 35348d585204c5d3abed32f54da392321ec6d29e..c692a18ed9da74399ec214579822e78f5c05e82b 100644 (file)
@@ -1017,7 +1017,7 @@ Parser::OwningStmtResult Parser::ParseGotoStatement() {
     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();
index 7549c9c69cff5d10aafdc6ff6ae7c2a0f2578b9b..b46dd5547fecf90034e5ad83e29624ff6237d4c2 100644 (file)
@@ -759,7 +759,6 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) {
   // 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()) {