diff options
-rw-r--r-- | include/clang/Basic/DiagnosticLexKinds.td | 3 | ||||
-rw-r--r-- | include/clang/Lex/Preprocessor.h | 3 | ||||
-rw-r--r-- | lib/Lex/PPDirectives.cpp | 15 | ||||
-rw-r--r-- | lib/Lex/PPMacroExpansion.cpp | 4 | ||||
-rw-r--r-- | lib/Lex/Pragma.cpp | 3 | ||||
-rw-r--r-- | test/Preprocessor/foo.framework/Headers/bar.h | 3 | ||||
-rw-r--r-- | test/Preprocessor/foo.framework/Headers/foo.h | 6 | ||||
-rw-r--r-- | test/Preprocessor/framework-include.m | 5 |
8 files changed, 5 insertions, 37 deletions
diff --git a/include/clang/Basic/DiagnosticLexKinds.td b/include/clang/Basic/DiagnosticLexKinds.td index 26a80b51c8..3f765bdfb3 100644 --- a/include/clang/Basic/DiagnosticLexKinds.td +++ b/include/clang/Basic/DiagnosticLexKinds.td @@ -172,9 +172,6 @@ def err_pp_hash_error : Error<"#error%0">; 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>">; diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index ad85122437..1e664c07a4 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -697,8 +697,7 @@ public: /// 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 diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp index dc5b204216..b0e784bcd9 100644 --- a/lib/Lex/PPDirectives.cpp +++ b/lib/Lex/PPDirectives.cpp @@ -402,7 +402,6 @@ void Preprocessor::PTHSkipExcludedConditionalBlock() { /// 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 @@ const FileEntry *Preprocessor::LookupFile(llvm::StringRef Filename, 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 @@ void Preprocessor::HandleIncludeDirective(Token &IncludeTok, // 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; diff --git a/lib/Lex/PPMacroExpansion.cpp b/lib/Lex/PPMacroExpansion.cpp index 37927827a8..13aeb88b1d 100644 --- a/lib/Lex/PPMacroExpansion.cpp +++ b/lib/Lex/PPMacroExpansion.cpp @@ -567,9 +567,7 @@ static bool EvaluateHasIncludeCommon(bool &Result, Token &Tok, // 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; diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp index 856b3bd76d..63b23b6d5c 100644 --- a/lib/Lex/Pragma.cpp +++ b/lib/Lex/Pragma.cpp @@ -301,8 +301,7 @@ void Preprocessor::HandlePragmaDependency(Token &DependencyTok) { // 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; diff --git a/test/Preprocessor/foo.framework/Headers/bar.h b/test/Preprocessor/foo.framework/Headers/bar.h deleted file mode 100644 index 574e851bb3..0000000000 --- a/test/Preprocessor/foo.framework/Headers/bar.h +++ /dev/null @@ -1,3 +0,0 @@ - -int y; - diff --git a/test/Preprocessor/foo.framework/Headers/foo.h b/test/Preprocessor/foo.framework/Headers/foo.h deleted file mode 100644 index b08d948fab..0000000000 --- a/test/Preprocessor/foo.framework/Headers/foo.h +++ /dev/null @@ -1,6 +0,0 @@ -// This should warn: published framework headers should always -// #import headers within the framework with framework paths. -#include "bar.h" - -int x; - diff --git a/test/Preprocessor/framework-include.m b/test/Preprocessor/framework-include.m deleted file mode 100644 index 7e50f18f39..0000000000 --- a/test/Preprocessor/framework-include.m +++ /dev/null @@ -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> - |