aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-22 00:14:44 +0000
committerChris Lattner <sabre@nondot.org>2010-01-22 00:14:44 +0000
commitf45b646244705410866d62f1d8bf017a047ed662 (patch)
tree7e06be60712adafd743487d325ebadb6678911fe /lib/Lex
parent4a415670481424a210df419a9f96e29db9939106 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94120 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex')
-rw-r--r--lib/Lex/PPDirectives.cpp15
-rw-r--r--lib/Lex/PPMacroExpansion.cpp4
-rw-r--r--lib/Lex/Pragma.cpp3
3 files changed, 4 insertions, 18 deletions
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;