diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-04-28 00:51:18 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-04-28 00:51:18 +0000 |
commit | 5d72d411899ce70d60b6ca58f92e61afd6349f2d (patch) | |
tree | 183dbbc1a4ecd1de7d5dc816b4df3a24b751e909 /clang/lib | |
parent | d0ae15946c09887c86312abddb23756dd30d73b3 (diff) | |
download | bcm5719-llvm-5d72d411899ce70d60b6ca58f92e61afd6349f2d.tar.gz bcm5719-llvm-5d72d411899ce70d60b6ca58f92e61afd6349f2d.zip |
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.
llvm-svn: 70273
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Lex/Lexer.cpp | 3 | ||||
-rw-r--r-- | clang/lib/Lex/LiteralSupport.cpp | 8 | ||||
-rw-r--r-- | clang/lib/Parse/ParseStmt.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 1 |
4 files changed, 5 insertions, 9 deletions
diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp index fff6f10fa9f..3f78be68c13 100644 --- a/clang/lib/Lex/Lexer.cpp +++ b/clang/lib/Lex/Lexer.cpp @@ -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. diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp index a3184e90ad8..03ecff91a57 100644 --- a/clang/lib/Lex/LiteralSupport.cpp +++ b/clang/lib/Lex/LiteralSupport.cpp @@ -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])) diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp index 35348d58520..c692a18ed9d 100644 --- a/clang/lib/Parse/ParseStmt.cpp +++ b/clang/lib/Parse/ParseStmt.cpp @@ -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(); diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 7549c9c69cf..b46dd5547fe 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -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()) { |