svn commit: r208961 - head/contrib/llvm/tools/clang/lib/Frontend
Roman Divacky
rdivacky at FreeBSD.org
Wed Jun 9 19:12:26 UTC 2010
Author: rdivacky
Date: Wed Jun 9 19:12:25 2010
New Revision: 208961
URL: http://svn.freebsd.org/changeset/base/208961
Log:
Adjust include paths to FreeBSD. Remove /usr/local/include and
add /usr/include/clang/$VERSION (currently VERSION is 2.0).
Approved by: ed (mentor)
Modified:
head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp
Modified: head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp
==============================================================================
--- head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp Wed Jun 9 19:10:27 2010 (r208960)
+++ head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp Wed Jun 9 19:12:25 2010 (r208961)
@@ -14,6 +14,7 @@
#include "clang/Frontend/Utils.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/LangOptions.h"
+#include "clang/Basic/Version.h"
#include "clang/Frontend/HeaderSearchOptions.h"
#include "clang/Lex/HeaderSearch.h"
#include "llvm/ADT/SmallString.h"
@@ -407,6 +408,7 @@ static bool getWindowsSDKDir(std::string
void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
const HeaderSearchOptions &HSOpts) {
+#if 0 /* Remove unneeded include paths. */
// FIXME: temporary hack: hard-coded paths.
AddPath("/usr/local/include", System, true, false, false);
@@ -419,6 +421,7 @@ void InitHeaderSearch::AddDefaultCInclud
P.appendComponent("include");
AddPath(P.str(), System, false, false, false, /*IgnoreSysRoot=*/ true);
}
+#endif
// Add dirs specified via 'configure --with-c-include-dirs'.
llvm::StringRef CIncludeDirs(C_INCLUDE_DIRS);
@@ -519,6 +522,8 @@ void InitHeaderSearch::AddDefaultCInclud
break;
}
+ AddPath("/usr/include/clang/" CLANG_VERSION_STRING,
+ System, false, false, false);
AddPath("/usr/include", System, false, false, false);
}
@@ -866,6 +871,16 @@ void clang::ApplyHeaderSearchOptions(Hea
else
Init.AddDelimitedPaths(HSOpts.CEnvIncPath);
+#if 0 /* We place built-in includes in /usr/include. */
+ if (HSOpts.UseBuiltinIncludes) {
+ // Ignore the sys root, we *always* look for clang headers relative to
+ // supplied path.
+ llvm::sys::Path P(HSOpts.ResourceDir);
+ P.appendComponent("include");
+ Init.AddPath(P.str(), System, false, false, false, /*IgnoreSysRoot=*/ true);
+ }
+#endif
+
if (HSOpts.UseStandardIncludes)
Init.AddDefaultSystemIncludePaths(Lang, Triple, HSOpts);
More information about the svn-src-head
mailing list