diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-08-21 06:04:45 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-08-21 06:04:45 +0000 |
commit | 944645af44c24985fe92f7dc3f1b7af085db97e7 (patch) | |
tree | b0199041630017c07f2c514afdca1240ed2cc7e8 /llvm/tools/llvmc/CompilerDriver.cpp | |
parent | 42bcf6ea76b26ba1eee23d12e13ce197d2b4d0e7 (diff) | |
download | bcm5719-llvm-944645af44c24985fe92f7dc3f1b7af085db97e7.tar.gz bcm5719-llvm-944645af44c24985fe92f7dc3f1b7af085db97e7.zip |
For PR797:
Adjust usage of the ExecuteAndWait function to use the last argument which
is the ErrMsg string. This is necessitated because this function no longer
throws exceptions on error.
llvm-svn: 29791
Diffstat (limited to 'llvm/tools/llvmc/CompilerDriver.cpp')
-rw-r--r-- | llvm/tools/llvmc/CompilerDriver.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/llvm/tools/llvmc/CompilerDriver.cpp b/llvm/tools/llvmc/CompilerDriver.cpp index 64232f3d2c1..a204964cd84 100644 --- a/llvm/tools/llvmc/CompilerDriver.cpp +++ b/llvm/tools/llvmc/CompilerDriver.cpp @@ -451,7 +451,7 @@ private: return action; } - bool DoAction(Action*action) { + int DoAction(Action*action, std::string& ErrMsg) { assert(action != 0 && "Invalid Action!"); if (isSet(VERBOSE_FLAG)) WriteAction(action); @@ -477,15 +477,17 @@ private: if (isSet(TIME_ACTIONS_FLAG)) { Timer timer(action->program.toString()); timer.startTimer(); - int resultCode = sys::Program::ExecuteAndWait(action->program, Args); + int resultCode = + sys::Program::ExecuteAndWait(action->program, Args,0,0,0,&ErrMsg); timer.stopTimer(); timer.print(timer,std::cerr); - return resultCode == 0; + return resultCode; } else - return 0 == sys::Program::ExecuteAndWait(action->program, Args); + return + sys::Program::ExecuteAndWait(action->program, Args, 0,0,0, &ErrMsg); } - return true; + return 0; } /// This method tries various variants of a linkage item's file @@ -594,7 +596,7 @@ private: /// @name Methods /// @{ public: - virtual int execute(const InputList& InpList, const sys::Path& Output ) { + virtual int execute(const InputList& InpList, const sys::Path& Output, std::string& ErrMsg ) { try { // Echo the configuration of options if we're running verbose if (isSet(DEBUG_FLAG)) { @@ -851,8 +853,9 @@ public: std::vector<Action*>::iterator AI = actions.begin(); std::vector<Action*>::iterator AE = actions.end(); while (AI != AE) { - if (!DoAction(*AI)) - throw std::string("Action failed"); + int ActionResult = DoAction(*AI, ErrMsg); + if (ActionResult != 0) + return ActionResult; AI++; } @@ -932,8 +935,9 @@ public: link->args.push_back(Output.toString()); // Execute the link - if (!DoAction(link)) - throw std::string("Action failed"); + int ActionResult = DoAction(link, ErrMsg); + if (ActionResult != 0) + return ActionResult; } } catch (std::string& msg) { cleanup(); |