diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-12-13 03:46:13 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-12-13 03:46:13 +0000 |
commit | 869824e87940f97b87064db2df2861e82e08a8c6 (patch) | |
tree | 46fa24160a6c50347a34be7967f0de7aa5d1f2f3 /tools/index-test/index-test.cpp | |
parent | 1e69fe3a9f0a42b32a3000bda51677d51416564e (diff) |
Lift builtin-include-path logic out of ASTUnit::LoadFromCommandLine and fix CIndex to pass in the right directory (previously it was using the path to the main executable, which generally is wrong).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91238 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/index-test/index-test.cpp')
-rw-r--r-- | tools/index-test/index-test.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/index-test/index-test.cpp b/tools/index-test/index-test.cpp index 0b1971f797..8b12c0ba8c 100644 --- a/tools/index-test/index-test.cpp +++ b/tools/index-test/index-test.cpp @@ -223,9 +223,12 @@ ASTUnit *CreateFromSource(const std::string &Filename, Diagnostic &Diags, for (unsigned i = 0, e = CompilerArgs.size(); i != e; ++i) Args.push_back(CompilerArgs[i].c_str()); + void *MainAddr = (void*) (intptr_t) CreateFromSource; + llvm::sys::Path ResourcesPath( + CompilerInvocation::GetBuiltinIncludePath(Argv0, MainAddr)); + ResourcesPath.eraseComponent(); return ASTUnit::LoadFromCommandLine(Args.data(), Args.data() + Args.size(), - Diags, Argv0, - (void*) (intptr_t) CreateFromSource); + Diags, ResourcesPath.str()); } int main(int argc, char **argv) { |