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
commit4ca906560a3d583b25f3bc366fbcac60f0a34434 (patch)
tree4e87bf5358ea5db7464c02e759396ef790361776 /tools
parent96e2cec9c743d1242be0e987f6873f74a15d2f80 (diff)
downloadexternal_llvm-4ca906560a3d583b25f3bc366fbcac60f0a34434.zip
external_llvm-4ca906560a3d583b25f3bc366fbcac60f0a34434.tar.gz
external_llvm-4ca906560a3d583b25f3bc366fbcac60f0a34434.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;
}