mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
Remove the program class.
It was only used to implement ExecuteAndWait and ExecuteNoWait. Expose just those two functions and make Execute and Wait implementations details. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183864 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -22,33 +22,31 @@ 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,
|
||||
static bool Execute(void *&Data, const Path &path, const char **args,
|
||||
const char **env, const sys::Path **redirects,
|
||||
unsigned memoryLimit, std::string *ErrMsg);
|
||||
|
||||
static int Wait(void *&Data, const Path &path, unsigned secondsToWait,
|
||||
std::string *ErrMsg);
|
||||
|
||||
int sys::ExecuteAndWait(const Path &path, const char **args, const char **envp,
|
||||
const Path **redirects, unsigned secondsToWait,
|
||||
unsigned memoryLimit, std::string *ErrMsg,
|
||||
bool *ExecutionFailed) {
|
||||
Program prg;
|
||||
if (prg.Execute(path, args, envp, redirects, memoryLimit, ErrMsg)) {
|
||||
void *Data;
|
||||
if (Execute(Data, path, args, envp, redirects, memoryLimit, ErrMsg)) {
|
||||
if (ExecutionFailed) *ExecutionFailed = false;
|
||||
return prg.Wait(path, secondsToWait, ErrMsg);
|
||||
return Wait(Data, path, secondsToWait, ErrMsg);
|
||||
}
|
||||
if (ExecutionFailed) *ExecutionFailed = true;
|
||||
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);
|
||||
void sys::ExecuteNoWait(const Path &path, const char **args, const char **envp,
|
||||
const Path **redirects, unsigned memoryLimit,
|
||||
std::string *ErrMsg) {
|
||||
void *Data;
|
||||
Execute(Data, path, args, envp, redirects, memoryLimit, ErrMsg);
|
||||
}
|
||||
|
||||
// Include the platform-specific parts of this class.
|
||||
|
Reference in New Issue
Block a user