summaryrefslogtreecommitdiff
path: root/tools/llvm-ld/llvm-ld.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-08-23 00:39:35 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-08-23 00:39:35 +0000
commite5c9cb5eb6bce502faaedea04014dab46f6540f4 (patch)
tree7e0155eeab8ecac7a202cff5d092c0f73c15cce8 /tools/llvm-ld/llvm-ld.cpp
parentb590a75eb566be4257f23340d3037ea1447e997e (diff)
downloadllvm-e5c9cb5eb6bce502faaedea04014dab46f6540f4.tar.gz
llvm-e5c9cb5eb6bce502faaedea04014dab46f6540f4.tar.bz2
llvm-e5c9cb5eb6bce502faaedea04014dab46f6540f4.tar.xz
For PR797:
Remove exceptions from the Path::create*OnDisk methods. Update their users to handle error messages via arguments and result codes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29840 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-ld/llvm-ld.cpp')
-rw-r--r--tools/llvm-ld/llvm-ld.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/llvm-ld/llvm-ld.cpp b/tools/llvm-ld/llvm-ld.cpp
index 679522f63d..53f04e6954 100644
--- a/tools/llvm-ld/llvm-ld.cpp
+++ b/tools/llvm-ld/llvm-ld.cpp
@@ -492,16 +492,15 @@ int main(int argc, char **argv, char **envp) {
}
// Get the program arguments
sys::Path tmp_output("opt_result");
- if (!tmp_output.createTemporaryFileOnDisk()) {
- return PrintAndReturn(
- "Can't create temporary file for post-link optimization");
+ std::string ErrMsg;
+ if (tmp_output.createTemporaryFileOnDisk(&ErrMsg)) {
+ return PrintAndReturn(ErrMsg);
}
const char* args[4];
args[0] = I->c_str();
args[1] = RealBytecodeOutput.c_str();
args[2] = tmp_output.c_str();
args[3] = 0;
- std::string ErrMsg;
if (0 == sys::Program::ExecuteAndWait(prog, args, 0,0,0, &ErrMsg)) {
if (tmp_output.isBytecodeFile()) {
sys::Path target(RealBytecodeOutput);