parent
479a9bd0ba
commit
4609ea8998
|
@ -52,6 +52,7 @@
|
||||||
#include "llvm/ADT/StringRef.h"
|
#include "llvm/ADT/StringRef.h"
|
||||||
#include "llvm/ExecutionEngine/ExecutionEngine.h"
|
#include "llvm/ExecutionEngine/ExecutionEngine.h"
|
||||||
#include "llvm/Support/Debug.h"
|
#include "llvm/Support/Debug.h"
|
||||||
|
#include "llvm/Support/FileSystem.h"
|
||||||
#include "llvm/Support/PathV1.h"
|
#include "llvm/Support/PathV1.h"
|
||||||
#include "llvm/Support/TargetSelect.h"
|
#include "llvm/Support/TargetSelect.h"
|
||||||
|
|
||||||
|
@ -81,19 +82,16 @@ using namespace lldb_private;
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
std::string GetBuiltinIncludePath(const char *Argv0) {
|
std::string GetBuiltinIncludePath(const char *Argv0) {
|
||||||
llvm::sys::Path P =
|
SmallString<128> P(llvm::sys::fs::getMainExecutable(
|
||||||
llvm::sys::Path::GetMainExecutable(Argv0,
|
Argv0, (void *)(intptr_t) GetBuiltinIncludePath));
|
||||||
(void*)(intptr_t) GetBuiltinIncludePath);
|
|
||||||
|
if (!P.empty()) {
|
||||||
if (!P.isEmpty()) {
|
llvm::sys::path::remove_filename(P); // Remove /clang from foo/bin/clang
|
||||||
P.eraseComponent(); // Remove /clang from foo/bin/clang
|
llvm::sys::path::remove_filename(P); // Remove /bin from foo/bin
|
||||||
P.eraseComponent(); // Remove /bin from foo/bin
|
|
||||||
|
|
||||||
// Get foo/lib/clang/<version>/include
|
// Get foo/lib/clang/<version>/include
|
||||||
P.appendComponent("lib");
|
llvm::sys::path::append(P, "lib", "clang", CLANG_VERSION_STRING,
|
||||||
P.appendComponent("clang");
|
"include");
|
||||||
P.appendComponent(CLANG_VERSION_STRING);
|
|
||||||
P.appendComponent("include");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return P.str();
|
return P.str();
|
||||||
|
|
Loading…
Reference in New Issue