summaryrefslogtreecommitdiffstats
path: root/clang/tools/libclang/CIndexer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/tools/libclang/CIndexer.cpp')
-rw-r--r--clang/tools/libclang/CIndexer.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/tools/libclang/CIndexer.cpp b/clang/tools/libclang/CIndexer.cpp
index 28ec7abb37a..03907884ac1 100644
--- a/clang/tools/libclang/CIndexer.cpp
+++ b/clang/tools/libclang/CIndexer.cpp
@@ -14,6 +14,7 @@
#include "CXString.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/Version.h"
+#include "clang/Driver/Driver.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/MD5.h"
@@ -62,7 +63,7 @@ const std::string &CIndexer::getClangResourcesPath() {
#endif
#endif
- LibClangPath += llvm::sys::path::parent_path(path);
+ LibClangPath += path;
#else
// This silly cast below avoids a C++ warning.
Dl_info info;
@@ -70,13 +71,11 @@ const std::string &CIndexer::getClangResourcesPath() {
llvm_unreachable("Call to dladdr() failed");
// We now have the CIndex directory, locate clang relative to it.
- LibClangPath += llvm::sys::path::parent_path(info.dli_fname);
+ LibClangPath += info.dli_fname;
#endif
- llvm::sys::path::append(LibClangPath, "clang", CLANG_VERSION_STRING);
-
// Cache our result.
- ResourcesPath = LibClangPath.str();
+ ResourcesPath = driver::Driver::GetResourcesPath(LibClangPath);
return ResourcesPath;
}
OpenPOWER on IntegriCloud