From 5a060775da43ec2ef37e839e93a0805d543708a9 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Wed, 23 Aug 2006 07:30:48 +0000 Subject: For PR797: Eliminate exception throwing from Path::renamePathOnDisk and adjust its users correspondingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29843 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-ld/llvm-ld.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/llvm-ld/llvm-ld.cpp b/tools/llvm-ld/llvm-ld.cpp index 53f04e6..6b9adaf 100644 --- a/tools/llvm-ld/llvm-ld.cpp +++ b/tools/llvm-ld/llvm-ld.cpp @@ -505,7 +505,10 @@ int main(int argc, char **argv, char **envp) { if (tmp_output.isBytecodeFile()) { sys::Path target(RealBytecodeOutput); target.eraseFromDisk(); - tmp_output.renamePathOnDisk(target); + if (tmp_output.renamePathOnDisk(target, &ErrMsg)) { + std::cerr << argv[0] << ": " << ErrMsg << "\n"; + return 2; + } } else return PrintAndReturn( "Post-link optimization output is not bytecode"); -- cgit v1.1