aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2011-05-24 04:31:14 +0000
committerNico Weber <nicolasweber@gmx.de>2011-05-24 04:31:14 +0000
commit74a5fd8bcc68b540b58f6fcd2d80e6e926966e71 (patch)
tree9344d37c06747ce7349a5303df983b47f9be7e9d /lib
parent0f161593b36584ec447e5268dbed2953489854d8 (diff)
Make it possible for external tools to distinguish between paths that come from -I and paths that come from -system. Patch from Paul Holden!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131955 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Frontend/InitHeaderSearch.cpp6
-rw-r--r--lib/Lex/HeaderSearch.cpp3
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp
index 4e0d4c1b43..9bdb13a944 100644
--- a/lib/Frontend/InitHeaderSearch.cpp
+++ b/lib/Frontend/InitHeaderSearch.cpp
@@ -1008,6 +1008,8 @@ void InitHeaderSearch::Realize(const LangOptions &Lang) {
if (it->first == Angled)
SearchList.push_back(it->second);
}
+ RemoveDuplicates(SearchList, quoted, Verbose);
+ unsigned angled = SearchList.size();
for (path_iterator it = IncludePath.begin(), ie = IncludePath.end();
it != ie; ++it) {
@@ -1021,10 +1023,10 @@ void InitHeaderSearch::Realize(const LangOptions &Lang) {
SearchList.push_back(it->second);
}
- RemoveDuplicates(SearchList, quoted, Verbose);
+ RemoveDuplicates(SearchList, angled, Verbose);
bool DontSearchCurDir = false; // TODO: set to true if -I- is set?
- Headers.SetSearchPaths(SearchList, quoted, DontSearchCurDir);
+ Headers.SetSearchPaths(SearchList, quoted, angled, DontSearchCurDir);
// If verbose, print the list of directories that will be searched.
if (Verbose) {
diff --git a/lib/Lex/HeaderSearch.cpp b/lib/Lex/HeaderSearch.cpp
index b3301164bd..bb4388195a 100644
--- a/lib/Lex/HeaderSearch.cpp
+++ b/lib/Lex/HeaderSearch.cpp
@@ -37,6 +37,7 @@ ExternalHeaderFileInfoSource::~ExternalHeaderFileInfoSource() {}
HeaderSearch::HeaderSearch(FileManager &FM)
: FileMgr(FM), FrameworkMap(64) {
+ AngledDirIdx = 0;
SystemDirIdx = 0;
NoCurDirSearch = false;
@@ -317,7 +318,7 @@ const FileEntry *HeaderSearch::LookupFile(
CurDir = 0;
// If this is a system #include, ignore the user #include locs.
- unsigned i = isAngled ? SystemDirIdx : 0;
+ unsigned i = isAngled ? AngledDirIdx : 0;
// If this is a #include_next request, start searching after the directory the
// file was found in.