aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-03-13 19:31:47 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-03-13 19:31:47 +0000
commitf2b544e487a5e7b61fad04503011070f295250ca (patch)
tree4e87bf5358ea5db7464c02e759396ef790361776 /tools
parent8cb9a3a88ffbd561745de9a0c70028efb464b1d5 (diff)
downloadexternal_llvm-f2b544e487a5e7b61fad04503011070f295250ca.zip
external_llvm-f2b544e487a5e7b61fad04503011070f295250ca.tar.gz
external_llvm-f2b544e487a5e7b61fad04503011070f295250ca.tar.bz2
llvm-mc: Delete output files on error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98445 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-mc/llvm-mc.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/llvm-mc/llvm-mc.cpp b/tools/llvm-mc/llvm-mc.cpp
index 666f0ba..66e1260 100644
--- a/tools/llvm-mc/llvm-mc.cpp
+++ b/tools/llvm-mc/llvm-mc.cpp
@@ -311,6 +311,10 @@ static int AssembleInput(const char *ProgName) {
if (Out != &fouts())
delete Out;
+ // Delete output on errors.
+ if (Res && OutputFilename != "-")
+ sys::Path(OutputFilename).eraseFromDisk();
+
return Res;
}