Fix clang executable path for Windows

llvm-svn: 86896
This commit is contained in:
John Thompson 2009-11-11 23:11:14 +00:00
parent 626d49f684
commit 92ebab90fe
1 changed files with 6 additions and 1 deletions

View File

@ -331,6 +331,11 @@ const llvm::sys::Path& CIndexer::getClangPath() {
GetModuleFileNameA((HINSTANCE)mbi.AllocationBase, path, MAX_PATH);
llvm::sys::Path CIndexPath(path);
CIndexPath.eraseComponent();
CIndexPath.appendComponent("clang");
CIndexPath.appendSuffix("exe");
CIndexPath.makeAbsolute();
#else
// This silly cast below avoids a C++ warning.
Dl_info info;
@ -338,13 +343,13 @@ const llvm::sys::Path& CIndexer::getClangPath() {
assert(0 && "Call to dladdr() failed");
llvm::sys::Path CIndexPath(info.dli_fname);
#endif
// We now have the CIndex directory, locate clang relative to it.
CIndexPath.eraseComponent();
CIndexPath.eraseComponent();
CIndexPath.appendComponent("bin");
CIndexPath.appendComponent("clang");
#endif
// Cache our result.
ClangPath = CIndexPath;