[cfe-commits] r94120 - in /cfe/trunk: include/clang/Basic/DiagnosticLexKinds.td include/clang/Lex/Preprocessor.h lib/Lex/PPDirectives.cpp lib/Lex/PPMacroExpansion.cpp lib/Lex/Pragma.cpp test/Preprocessor/foo.framework/ test/Preprocessor/framework-include.m

Chris Lattner sabre at nondot.org
Thu Jan 21 16:14:45 PST 2010


Author: lattner
Date: Thu Jan 21 18:14:44 2010
New Revision: 94120

URL: http://llvm.org/viewvc/llvm-project?rev=94120&view=rev
Log:
revert my patch for rdar://7520940 that warns when a published header
is #included with "foo.h" style syntax instead of framework syntax.
It produced too much noise.

Removed:
    cfe/trunk/test/Preprocessor/foo.framework/
    cfe/trunk/test/Preprocessor/framework-include.m
Modified:
    cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td
    cfe/trunk/include/clang/Lex/Preprocessor.h
    cfe/trunk/lib/Lex/PPDirectives.cpp
    cfe/trunk/lib/Lex/PPMacroExpansion.cpp
    cfe/trunk/lib/Lex/Pragma.cpp

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

==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td Thu Jan 21 18:14:44 2010
@@ -172,9 +172,6 @@
 def err_pp_file_not_found : Error<"'%0' file not found">, DefaultFatal;
 def err_pp_error_opening_file : Error<
   "error opening file '%0': %1">, DefaultFatal;
-def warn_pp_relative_include_from_framework : Warning<
-  "published framework headers should always #import headers within the "
-  "framework with framework paths">, InGroup<DiagGroup<"framework-headers">>;
 def err_pp_empty_filename : Error<"empty filename">;
 def err_pp_include_too_deep : Error<"#include nested too deeply">;
 def err_pp_expects_filename : Error<"expected \"FILENAME\" or <FILENAME>">;

Modified: cfe/trunk/include/clang/Lex/Preprocessor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=94120&r1=94119&r2=94120&view=diff

==============================================================================
--- cfe/trunk/include/clang/Lex/Preprocessor.h (original)
+++ cfe/trunk/include/clang/Lex/Preprocessor.h Thu Jan 21 18:14:44 2010
@@ -697,8 +697,7 @@
   /// return null on failure.  isAngled indicates whether the file reference is
   /// for system #include's or not (i.e. using <> instead of "").
   const FileEntry *LookupFile(llvm::StringRef Filename,
-                              SourceLocation FilenameTokLoc, bool isAngled,
-                              const DirectoryLookup *FromDir,
+                              bool isAngled, const DirectoryLookup *FromDir,
                               const DirectoryLookup *&CurDir);
 
   /// GetCurLookup - The DirectoryLookup structure used to find the current

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

==============================================================================
--- cfe/trunk/lib/Lex/PPDirectives.cpp (original)
+++ cfe/trunk/lib/Lex/PPDirectives.cpp Thu Jan 21 18:14:44 2010
@@ -402,7 +402,6 @@
 /// return null on failure.  isAngled indicates whether the file reference is
 /// for system #include's or not (i.e. using <> instead of "").
 const FileEntry *Preprocessor::LookupFile(llvm::StringRef Filename,
-                                          SourceLocation FilenameTokLoc,
                                           bool isAngled,
                                           const DirectoryLookup *FromDir,
                                           const DirectoryLookup *&CurDir) {
@@ -429,16 +428,7 @@
   CurDir = CurDirLookup;
   const FileEntry *FE =
     HeaderInfo.LookupFile(Filename, isAngled, FromDir, CurDir, CurFileEnt);
-  if (FE) {
-    // Warn about normal quoted #include from framework headers.  Since
-    // framework headers are published (both public and private ones) they
-    // should not do relative searches, they should do an include with the
-    // framework path included.
-    if (!isAngled && CurDir && FilenameTokLoc.isValid() &&
-        CurDir->isFramework() && CurDir == CurDirLookup)
-      Diag(FilenameTokLoc, diag::warn_pp_relative_include_from_framework);
-    return FE;
-  }
+  if (FE) return FE;
 
   // Otherwise, see if this is a subframework header.  If so, this is relative
   // to one of the headers on the #include stack.  Walk the list of the current
@@ -1079,8 +1069,7 @@
 
   // Search include directories.
   const DirectoryLookup *CurDir;
-  const FileEntry *File = LookupFile(Filename, FilenameTok.getLocation(),
-                                     isAngled, LookupFrom, CurDir);
+  const FileEntry *File = LookupFile(Filename, isAngled, LookupFrom, CurDir);
   if (File == 0) {
     Diag(FilenameTok, diag::err_pp_file_not_found) << Filename;
     return;

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

==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Thu Jan 21 18:14:44 2010
@@ -567,9 +567,7 @@
 
   // Search include directories.
   const DirectoryLookup *CurDir;
-  const FileEntry *File = PP.LookupFile(Filename,
-                                        SourceLocation(),// produce no warnings.
-                                        isAngled, LookupFrom, CurDir);
+  const FileEntry *File = PP.LookupFile(Filename, isAngled, LookupFrom, CurDir);
 
   // Get the result value.  Result = true means the file exists.
   Result = File != 0;

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

==============================================================================
--- cfe/trunk/lib/Lex/Pragma.cpp (original)
+++ cfe/trunk/lib/Lex/Pragma.cpp Thu Jan 21 18:14:44 2010
@@ -301,8 +301,7 @@
 
   // Search include directories for this file.
   const DirectoryLookup *CurDir;
-  const FileEntry *File = LookupFile(Filename, FilenameTok.getLocation(),
-                                     isAngled, 0, CurDir);
+  const FileEntry *File = LookupFile(Filename, isAngled, 0, CurDir);
   if (File == 0) {
     Diag(FilenameTok, diag::err_pp_file_not_found) << Filename;
     return;

Removed: cfe/trunk/test/Preprocessor/framework-include.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/framework-include.m?rev=94119&view=auto

==============================================================================
--- cfe/trunk/test/Preprocessor/framework-include.m (original)
+++ cfe/trunk/test/Preprocessor/framework-include.m (removed)
@@ -1,5 +0,0 @@
-// RUN: %clang -E -F%S %s 2>&1 | grep "published framework headers should always #import headers within the framework with framework paths"
-
-// rdar://7520940
-#include <foo/foo.h>
-





More information about the cfe-commits mailing list