r184918 - Remove PathV1.h from CompilerInvocation.cpp.
Rafael Espindola
rafael.espindola at gmail.com
Tue Jun 25 22:40:30 PDT 2013
Author: rafael
Date: Wed Jun 26 00:40:30 2013
New Revision: 184918
URL: http://llvm.org/viewvc/llvm-project?rev=184918&view=rev
Log:
Remove PathV1.h from CompilerInvocation.cpp.
Modified:
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=184918&r1=184917&r2=184918&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Wed Jun 26 00:40:30 2013
@@ -32,7 +32,6 @@
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Host.h"
#include "llvm/Support/Path.h"
-#include "llvm/Support/PathV1.h"
#include "llvm/Support/system_error.h"
#include <sys/stat.h>
using namespace clang;
@@ -846,16 +845,16 @@ static InputKind ParseFrontendArgs(Front
std::string CompilerInvocation::GetResourcesPath(const char *Argv0,
void *MainAddr) {
- llvm::sys::Path P(llvm::sys::fs::getMainExecutable(Argv0, MainAddr));
+ SmallString<128> P(llvm::sys::fs::getMainExecutable(Argv0, MainAddr));
- if (!P.isEmpty()) {
- P.eraseComponent(); // Remove /clang from foo/bin/clang
- P.eraseComponent(); // Remove /bin from foo/bin
+ 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);
+ llvm::sys::path::append(P, "lib");
+ llvm::sys::path::append(P, "clang");
+ llvm::sys::path::append(P, CLANG_VERSION_STRING);
}
return P.str();
More information about the cfe-commits
mailing list