X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FSystem%2FProgram.cpp;h=a3049d46fd654bc9b9d6c1fbefa8164381511a7e;hb=850f1cd3c0c6feefd64f389ecb0e078d0b2bd9db;hp=e91a3d54c2ec05c4a250318d3676b3db56de7ff8;hpb=23dd3327a03b9b64b428ea07dae580326159e47b;p=oota-llvm.git diff --git a/lib/System/Program.cpp b/lib/System/Program.cpp index e91a3d54c2e..a3049d46fd6 100644 --- a/lib/System/Program.cpp +++ b/lib/System/Program.cpp @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by Reid Spencer and is distributed under the -// University of Illinois Open Source License. See LICENSE.TXT for details. +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -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. @@ -31,5 +58,3 @@ using namespace sys; #ifdef LLVM_ON_WIN32 #include "Win32/Program.inc" #endif - -DEFINING_FILE_FOR(SystemProgram)