From 869824e87940f97b87064db2df2861e82e08a8c6 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sun, 13 Dec 2009 03:46:13 +0000 Subject: 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 --- tools/index-test/index-test.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tools/index-test/index-test.cpp') 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) { -- cgit v1.2.3-18-g5258