[llvm-dwp] Avoid writing the output dwp file when there is an error

Summary: Use ToolOutputFile to clean up the output file unless dwp actually finishes successfully.

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D58130

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353873 91177308-0d34-0410-b5e6-96231b3b80d8
2 files changed