aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Thompson <John.Thompson.JTSoftware@gmail.com>2009-11-11 23:11:14 +0000
committerJohn Thompson <John.Thompson.JTSoftware@gmail.com>2009-11-11 23:11:14 +0000
commit6a6742a8fc3b056e057e8eb34084e3ecc8f028af (patch)
tree0d466f9a6c34f4b8620fb1dff91c2aa2ca687ab2
parentdb0d4b751e83b8841b8f48f913f17e50467f13d4 (diff)
Fix clang executable path for Windows
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86896 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/CIndex/CIndex.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp
index da73ae40a3..69cb52b485 100644
--- a/tools/CIndex/CIndex.cpp
+++ b/tools/CIndex/CIndex.cpp
@@ -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;