[llvm] r178087 - Add a boolean parameter to the ExecuteAndWait static function to indicated
Chad Rosier
mcrosier at apple.com
Tue Mar 26 16:35:00 PDT 2013
Author: mcrosier
Date: Tue Mar 26 18:35:00 2013
New Revision: 178087
URL: http://llvm.org/viewvc/llvm-project?rev=178087&view=rev
Log:
Add a boolean parameter to the ExecuteAndWait static function to indicated
if execution failed. ExecuteAndWait returns -1 upon an execution failure, but
checking the return value isn't sufficient because the wait command may
return -1 as well. This new parameter is to be used by the clang driver in a
subsequent commit.
Part of rdar://13362359
Modified:
llvm/trunk/include/llvm/Support/Program.h
llvm/trunk/lib/Support/Program.cpp
Modified: llvm/trunk/include/llvm/Support/Program.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Program.h?rev=178087&r1=178086&r2=178087&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Program.h (original)
+++ llvm/trunk/include/llvm/Support/Program.h Tue Mar 26 18:35:00 2013
@@ -125,7 +125,8 @@ namespace sys {
const sys::Path** redirects = 0,
unsigned secondsToWait = 0,
unsigned memoryLimit = 0,
- std::string* ErrMsg = 0);
+ std::string* ErrMsg = 0,
+ bool *ExecutionFailed = 0);
/// A convenience function equivalent to Program prg; prg.Execute(..);
/// @see Execute
Modified: llvm/trunk/lib/Support/Program.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Program.cpp?rev=178087&r1=178086&r2=178087&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Program.cpp (original)
+++ llvm/trunk/lib/Support/Program.cpp Tue Mar 26 18:35:00 2013
@@ -29,12 +29,15 @@ Program::ExecuteAndWait(const Path& path
const Path** redirects,
unsigned secondsToWait,
unsigned memoryLimit,
- std::string* ErrMsg) {
+ std::string* ErrMsg,
+ bool *ExecutionFailed) {
Program prg;
- if (prg.Execute(path, args, envp, redirects, memoryLimit, ErrMsg))
+ if (prg.Execute(path, args, envp, redirects, memoryLimit, ErrMsg)) {
+ if (ExecutionFailed) *ExecutionFailed = false;
return prg.Wait(path, secondsToWait, ErrMsg);
- else
- return -1;
+ }
+ if (ExecutionFailed) *ExecutionFailed = true;
+ return -1;
}
void
More information about the llvm-commits
mailing list