r183935 - Use the sys::ExecuteAndWait that takes StringRefs.
Rafael Espindola
rafael.espindola at gmail.com
Thu Jun 13 13:08:52 PDT 2013
Author: rafael
Date: Thu Jun 13 15:08:52 2013
New Revision: 183935
URL: http://llvm.org/viewvc/llvm-project?rev=183935&view=rev
Log:
Use the sys::ExecuteAndWait that takes StringRefs.
Also don't depend on Program.h including PathV1.h.
Modified:
cfe/trunk/include/clang/Driver/Compilation.h
cfe/trunk/lib/Driver/Compilation.cpp
cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp
Modified: cfe/trunk/include/clang/Driver/Compilation.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Compilation.h?rev=183935&r1=183934&r2=183935&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Compilation.h (original)
+++ cfe/trunk/include/clang/Driver/Compilation.h Thu Jun 13 15:08:52 2013
@@ -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,
Modified: cfe/trunk/lib/Driver/Compilation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Compilation.cpp?rev=183935&r1=183934&r2=183935&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Compilation.cpp (original)
+++ cfe/trunk/lib/Driver/Compilation.cpp Thu Jun 13 15:08:52 2013
@@ -291,7 +291,7 @@ int Compilation::ExecuteCommand(const Co
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::initCompilationForDiag
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 {
Modified: cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp?rev=183935&r1=183934&r2=183935&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp Thu Jun 13 15:08:52 2013
@@ -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";
}
Modified: cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp?rev=183935&r1=183934&r2=183935&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp (original)
+++ cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp Thu Jun 13 15:08:52 2013
@@ -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"
More information about the cfe-commits
mailing list