From e5c9cb5eb6bce502faaedea04014dab46f6540f4 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Wed, 23 Aug 2006 00:39:35 +0000 Subject: 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 --- tools/llvm-ld/llvm-ld.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tools/llvm-ld') diff --git a/tools/llvm-ld/llvm-ld.cpp b/tools/llvm-ld/llvm-ld.cpp index 679522f..53f04e6 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); -- cgit v1.1