[cfe-commits] r90826 - in /cfe/trunk: include/clang/Basic/DiagnosticLexKinds.td lib/Lex/PPMacroExpansion.cpp

Eli Friedman eli.friedman at gmail.com
Mon Dec 7 18:22:26 PST 2009


Author: efriedma
Date: Mon Dec  7 20:22:26 2009
New Revision: 90826

URL: http://llvm.org/viewvc/llvm-project?rev=90826&view=rev
Log:
Get rid of some diagnostics that don't follow our rules for -pedantic
diagnostics (specifically, that any extension in a compiler-reserved namespace
shouldn't trigger a diagnostic).


Modified:
    cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td
    cfe/trunk/lib/Lex/PPMacroExpansion.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td?rev=90826&r1=90825&r2=90826&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td Mon Dec  7 20:22:26 2009
@@ -160,13 +160,6 @@
 def ext_empty_fnmacro_arg : Extension<
   "empty macro arguments were standardized in C99">;
 
-def ext_pp_base_file : Extension<"__BASE_FILE__ is a language extension">;
-def ext_pp_include_level : Extension<
-  "__INCLUDE_LEVEL__ is a language extension">;
-def ext_pp_timestamp : Extension<"__TIMESTAMP__ is a language extension">;
-def ext_pp_counter : Extension<
-  "__COUNTER__ is a language extension">;
-
 def err_pp_invalid_directive : Error<"invalid preprocessing directive">;
 def err_pp_hash_error : Error<"#error%0">;
 def err_pp_file_not_found : Error<"'%0' file not found">, DefaultFatal;

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

==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Mon Dec  7 20:22:26 2009
@@ -673,7 +673,6 @@
     // __BASE_FILE__ is a GNU extension that returns the top of the presumed
     // #include stack instead of the current file.
     if (II == Ident__BASE_FILE__) {
-      Diag(Tok, diag::ext_pp_base_file);
       SourceLocation NextLoc = PLoc.getIncludeLoc();
       while (NextLoc.isValid()) {
         PLoc = SourceMgr.getPresumedLoc(NextLoc);
@@ -703,8 +702,6 @@
                                                      Tok.getLocation(),
                                                      Tok.getLength()));
   } else if (II == Ident__INCLUDE_LEVEL__) {
-    Diag(Tok, diag::ext_pp_include_level);
-
     // Compute the presumed include depth of this token.  This can be affected
     // by GNU line markers.
     unsigned Depth = 0;
@@ -721,7 +718,6 @@
   } else if (II == Ident__TIMESTAMP__) {
     // MSVC, ICC, GCC, VisualAge C++ extension.  The generated string should be
     // of the form "Ddd Mmm dd hh::mm::ss yyyy", which is returned by asctime.
-    Diag(Tok, diag::ext_pp_timestamp);
 
     // Get the file that we are lexing out of.  If we're currently lexing from
     // a macro, dig into the include stack.
@@ -731,7 +727,6 @@
     if (TheLexer)
       CurFile = SourceMgr.getFileEntryForID(TheLexer->getFileID());
 
-    // If this file is older than the file it depends on, emit a diagnostic.
     const char *Result;
     if (CurFile) {
       time_t TT = CurFile->getModificationTime();
@@ -747,8 +742,6 @@
     Tok.setKind(tok::string_literal);
     CreateString(TmpBuffer, Len+1, Tok, Tok.getLocation());
   } else if (II == Ident__COUNTER__) {
-    Diag(Tok, diag::ext_pp_counter);
-
     // __COUNTER__ expands to a simple numeric value.
     sprintf(TmpBuffer, "%u", CounterValue++);
     Tok.setKind(tok::numeric_constant);





More information about the cfe-commits mailing list