aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-12-15 00:06:45 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-12-15 00:06:45 +0000
commit8b9adfea5e834eaee0f45d8cc7fb052d68df4a46 (patch)
tree0ca64758fa0162c3ab4caa04fd2705983d455503 /tools
parent71d1740c94060b424bb745d6c6973ff27cfdee06 (diff)
Add -resource-dir to clang -cc1, this allows the base directory for compiler
resources (e.g., /usr/lib/clang/1.1) to be passed on the command line instead of computed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91370 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/driver/cc1_main.cpp6
-rw-r--r--tools/index-test/index-test.cpp7
2 files changed, 6 insertions, 7 deletions
diff --git a/tools/driver/cc1_main.cpp b/tools/driver/cc1_main.cpp
index 5d7daccabd..6e82c51d38 100644
--- a/tools/driver/cc1_main.cpp
+++ b/tools/driver/cc1_main.cpp
@@ -211,9 +211,9 @@ int cc1_main(const char **ArgBegin, const char **ArgEnd,
// Infer the builtin include path if unspecified.
if (Clang.getInvocation().getHeaderSearchOpts().UseBuiltinIncludes &&
- Clang.getInvocation().getHeaderSearchOpts().BuiltinIncludePath.empty())
- Clang.getInvocation().getHeaderSearchOpts().BuiltinIncludePath =
- CompilerInvocation::GetBuiltinIncludePath(Argv0, MainAddr);
+ Clang.getInvocation().getHeaderSearchOpts().ResourceDir.empty())
+ Clang.getInvocation().getHeaderSearchOpts().ResourceDir =
+ CompilerInvocation::GetResourcesPath(Argv0, MainAddr);
// Honor -help.
if (Clang.getInvocation().getFrontendOpts().ShowHelp) {
diff --git a/tools/index-test/index-test.cpp b/tools/index-test/index-test.cpp
index 8b12c0ba8c..ff9fd54311 100644
--- a/tools/index-test/index-test.cpp
+++ b/tools/index-test/index-test.cpp
@@ -224,11 +224,10 @@ ASTUnit *CreateFromSource(const std::string &Filename, Diagnostic &Diags,
Args.push_back(CompilerArgs[i].c_str());
void *MainAddr = (void*) (intptr_t) CreateFromSource;
- llvm::sys::Path ResourcesPath(
- CompilerInvocation::GetBuiltinIncludePath(Argv0, MainAddr));
- ResourcesPath.eraseComponent();
+ std::string ResourceDir =
+ CompilerInvocation::GetResourcesPath(Argv0, MainAddr);
return ASTUnit::LoadFromCommandLine(Args.data(), Args.data() + Args.size(),
- Diags, ResourcesPath.str());
+ Diags, ResourceDir);
}
int main(int argc, char **argv) {