summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/Program.cpp
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2009-07-18 21:43:12 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2009-07-18 21:43:12 +0000
commit36cb83202d3833f76778eab7a9481384113cab06 (patch)
tree70e7f2a68bb46391566a70b2e24446450bfd6bce /llvm/lib/System/Program.cpp
parent27b50135eed7f1497c82783b21ae8debec910f4f (diff)
downloadbcm5719-llvm-36cb83202d3833f76778eab7a9481384113cab06.tar.gz
bcm5719-llvm-36cb83202d3833f76778eab7a9481384113cab06.zip
Remove duplication in Program::Execute{And,No}Wait.
Implemented by moving the code out of static functions into methods of Program class. llvm-svn: 76340
Diffstat (limited to 'llvm/lib/System/Program.cpp')
-rw-r--r--llvm/lib/System/Program.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/lib/System/Program.cpp b/llvm/lib/System/Program.cpp
index eb289d81b2e..a3049d46fd6 100644
--- a/llvm/lib/System/Program.cpp
+++ b/llvm/lib/System/Program.cpp
@@ -22,6 +22,33 @@ using namespace sys;
//=== independent code.
//===----------------------------------------------------------------------===//
+int
+Program::ExecuteAndWait(const Path& path,
+ const char** args,
+ const char** envp,
+ const Path** redirects,
+ unsigned secondsToWait,
+ unsigned memoryLimit,
+ std::string* ErrMsg) {
+ Program prg;
+ if (prg.Execute(path, args, envp, redirects, memoryLimit, ErrMsg))
+ return prg.Wait(secondsToWait, ErrMsg);
+ else
+ return -1;
+}
+
+void
+Program::ExecuteNoWait(const Path& path,
+ const char** args,
+ const char** envp,
+ const Path** redirects,
+ unsigned memoryLimit,
+ std::string* ErrMsg) {
+ Program prg;
+ prg.Execute(path, args, envp, redirects, memoryLimit, ErrMsg);
+}
+
+
}
// Include the platform-specific parts of this class.
OpenPOWER on IntegriCloud