summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-26 14:10:56 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-26 14:10:56 +0000
commit4609ea8998e80e01cde6204fe3475fd33e02ebdb (patch)
treee4fc093f1fac5c1200cadfcebb22b877ccef1c57
parent479a9bd0ba6fac781611728f574aef43d58533b7 (diff)
downloadbcm5719-llvm-4609ea8998e80e01cde6204fe3475fd33e02ebdb.tar.gz
bcm5719-llvm-4609ea8998e80e01cde6204fe3475fd33e02ebdb.zip
Fix the lldb build.
llvm-svn: 184948
-rw-r--r--lldb/source/Expression/ClangExpressionParser.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/lldb/source/Expression/ClangExpressionParser.cpp b/lldb/source/Expression/ClangExpressionParser.cpp
index d026f2f3c12..aeeea91a93f 100644
--- a/lldb/source/Expression/ClangExpressionParser.cpp
+++ b/lldb/source/Expression/ClangExpressionParser.cpp
@@ -52,6 +52,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/FileSystem.h"
#include "llvm/Support/PathV1.h"
#include "llvm/Support/TargetSelect.h"
@@ -81,19 +82,16 @@ using namespace lldb_private;
//===----------------------------------------------------------------------===//
std::string GetBuiltinIncludePath(const char *Argv0) {
- llvm::sys::Path P =
- llvm::sys::Path::GetMainExecutable(Argv0,
- (void*)(intptr_t) GetBuiltinIncludePath);
-
- if (!P.isEmpty()) {
- P.eraseComponent(); // Remove /clang from foo/bin/clang
- P.eraseComponent(); // Remove /bin from foo/bin
-
+ SmallString<128> P(llvm::sys::fs::getMainExecutable(
+ Argv0, (void *)(intptr_t) GetBuiltinIncludePath));
+
+ if (!P.empty()) {
+ llvm::sys::path::remove_filename(P); // Remove /clang from foo/bin/clang
+ llvm::sys::path::remove_filename(P); // Remove /bin from foo/bin
+
// Get foo/lib/clang/<version>/include
- P.appendComponent("lib");
- P.appendComponent("clang");
- P.appendComponent(CLANG_VERSION_STRING);
- P.appendComponent("include");
+ llvm::sys::path::append(P, "lib", "clang", CLANG_VERSION_STRING,
+ "include");
}
return P.str();
OpenPOWER on IntegriCloud