From: Rafael Espindola Date: Wed, 26 Jun 2013 05:40:30 +0000 (+0000) Subject: Remove PathV1.h from CompilerInvocation.cpp. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3473c8de3cb8de1cedc25151909514af05a25450;p=clang Remove PathV1.h from CompilerInvocation.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184918 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 49ce0b7f82..f362226459 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -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 using namespace clang; @@ -846,16 +845,16 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args, 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//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();