diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-08-01 19:21:43 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-08-01 19:21:43 +0000 | 
| commit | 74fa70bc51b4ea9006bd31c36b96a4b306e1a5f2 (patch) | |
| tree | fc85e3c6a1b6d9c466661dc07ad3aa2751c9bf05 | |
| parent | 958f47b9f7a4a732805ccec7925800e0f0ab2b60 (diff) | |
| download | bcm5719-llvm-74fa70bc51b4ea9006bd31c36b96a4b306e1a5f2.tar.gz bcm5719-llvm-74fa70bc51b4ea9006bd31c36b96a4b306e1a5f2.zip  | |
Make sure to delete the output file if there is an error
llvm-svn: 7481
| -rw-r--r-- | llvm/support/tools/TableGen/TableGen.cpp | 5 | 
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/support/tools/TableGen/TableGen.cpp b/llvm/support/tools/TableGen/TableGen.cpp index 4b0cd9d2a33..088dcbe0e39 100644 --- a/llvm/support/tools/TableGen/TableGen.cpp +++ b/llvm/support/tools/TableGen/TableGen.cpp @@ -431,7 +431,10 @@ int main(int argc, char **argv) {      }    } catch (const std::string &Error) {      std::cerr << Error << "\n"; -    if (Out != &std::cout) delete Out; +    if (Out != &std::cout) { +      delete Out;                             // Close the file +      std::remove(OutputFilename.c_str());    // Remove the file, it's broken +    }      return 1;    }  | 

