From: Rafael Espindola Date: Thu, 13 Jun 2013 20:08:52 +0000 (+0000) Subject: Use the sys::ExecuteAndWait that takes StringRefs. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=57a3bbfa9a97f174b0c80b0309e32f4329c4ae1b;p=clang Use the sys::ExecuteAndWait that takes StringRefs. Also don't depend on Program.h including PathV1.h. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183935 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Driver/Compilation.h b/include/clang/Driver/Compilation.h index 466c86f47d..3f9bb5aad7 100644 --- a/include/clang/Driver/Compilation.h +++ b/include/clang/Driver/Compilation.h @@ -63,7 +63,7 @@ class Compilation { ArgStringMap FailureResultFiles; /// Redirection for stdout, stderr, etc. - const llvm::sys::Path **Redirects; + const StringRef **Redirects; public: Compilation(const Driver &D, const ToolChain &DefaultToolChain, diff --git a/lib/Driver/Compilation.cpp b/lib/Driver/Compilation.cpp index bc1a75a44a..1ab47f3bbf 100644 --- a/lib/Driver/Compilation.cpp +++ b/lib/Driver/Compilation.cpp @@ -291,7 +291,7 @@ int Compilation::ExecuteCommand(const Command &C, std::string Error; bool ExecutionFailed; - int Res = llvm::sys::ExecuteAndWait(Prog, Argv, /*env*/ 0, Redirects, + int Res = llvm::sys::ExecuteAndWait(Prog.str(), Argv, /*env*/ 0, Redirects, /*secondsToWait*/ 0, /*memoryLimit*/ 0, &Error, &ExecutionFailed); if (!Error.empty()) { @@ -368,9 +368,10 @@ void Compilation::initCompilationForDiagnostics() { TranslatedArgs->ClaimAllArgs(); // Redirect stdout/stderr to /dev/null. - Redirects = new const llvm::sys::Path*[3](); - Redirects[1] = new const llvm::sys::Path(); - Redirects[2] = new const llvm::sys::Path(); + Redirects = new const StringRef*[3](); + Redirects[0] = 0; + Redirects[1] = new const StringRef(); + Redirects[2] = new const StringRef(); } StringRef Compilation::getSysRoot() const { diff --git a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp index 635e3fc006..edea27bd8e 100644 --- a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp +++ b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp @@ -41,6 +41,7 @@ #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/Statistic.h" #include "llvm/Support/Path.h" +#include "llvm/Support/PathV1.h" #include "llvm/Support/Program.h" #include "llvm/Support/Timer.h" #include "llvm/Support/raw_ostream.h" @@ -775,8 +776,7 @@ UbigraphViz::~UbigraphViz() { args.push_back(Filename.c_str()); args.push_back(0); - if (llvm::sys::ExecuteAndWait(llvm::sys::Path(Ubiviz), &args[0], 0, 0, 0, 0, - &ErrMsg)) { + if (llvm::sys::ExecuteAndWait(Ubiviz, &args[0], 0, 0, 0, 0, &ErrMsg)) { llvm::errs() << "Error viewing graph: " << ErrMsg << "\n"; } diff --git a/tools/libclang/CIndexCodeCompletion.cpp b/tools/libclang/CIndexCodeCompletion.cpp index f79de2909e..bfd54f5c00 100644 --- a/tools/libclang/CIndexCodeCompletion.cpp +++ b/tools/libclang/CIndexCodeCompletion.cpp @@ -32,6 +32,7 @@ #include "llvm/Support/Atomic.h" #include "llvm/Support/CrashRecoveryContext.h" #include "llvm/Support/MemoryBuffer.h" +#include "llvm/Support/PathV1.h" #include "llvm/Support/Program.h" #include "llvm/Support/Timer.h" #include "llvm/Support/raw_ostream.h"