aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2009-11-23 16:31:19 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2009-11-23 16:31:19 +0000
commit6ec18a3f86c702004af66cce6ff979999a736898 (patch)
treec1dd0f6048926bec7368f0aa3efa33340caf4490 /lib/Frontend
parenteb0d8c95b43549ebf1acbb78d597901ace6dc8b7 (diff)
Reorder the header search a bit so that it matches gcc exactly:
*) the ../backward dir is the last in libstdc++ to be searched *) If compiling c++, the c++ headers are searched first git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89661 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend')
-rw-r--r--lib/Frontend/InitHeaderSearch.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp
index 7f54b52ab5..221ef14f10 100644
--- a/lib/Frontend/InitHeaderSearch.cpp
+++ b/lib/Frontend/InitHeaderSearch.cpp
@@ -170,9 +170,8 @@ void InitHeaderSearch::AddGnuCPlusPlusIncludePaths(const std::string &Base,
const char *Dir32,
const char *Dir64,
const llvm::Triple &triple) {
- // Add the common dirs
+ // Add the base dir
AddPath(Base, System, true, false, false);
- AddPath(Base + "/backward", System, true, false, false);
// Add the multilib dirs
llvm::Triple::ArchType arch = triple.getArch();
@@ -181,6 +180,9 @@ void InitHeaderSearch::AddGnuCPlusPlusIncludePaths(const std::string &Base,
AddPath(Base + "/" + ArchDir + "/" + Dir64, System, true, false, false);
else
AddPath(Base + "/" + ArchDir + "/" + Dir32, System, true, false, false);
+
+ // Add the backward dir
+ AddPath(Base + "/backward", System, true, false, false);
}
void InitHeaderSearch::AddMinGWCPlusPlusIncludePaths(const std::string &Base,
@@ -543,6 +545,9 @@ void InitHeaderSearch::AddDefaultCPlusPlusIncludePaths(const llvm::Triple &tripl
void InitHeaderSearch::AddDefaultSystemIncludePaths(const LangOptions &Lang,
const llvm::Triple &triple) {
+ if (Lang.CPlusPlus)
+ AddDefaultCPlusPlusIncludePaths(triple);
+
AddDefaultCIncludePaths(triple);
// Add the default framework include paths on Darwin.
@@ -550,9 +555,6 @@ void InitHeaderSearch::AddDefaultSystemIncludePaths(const LangOptions &Lang,
AddPath("/System/Library/Frameworks", System, true, false, true);
AddPath("/Library/Frameworks", System, true, false, true);
}
-
- if (Lang.CPlusPlus)
- AddDefaultCPlusPlusIncludePaths(triple);
}
/// RemoveDuplicates - If there are duplicate directory entries in the specified