diff options
| -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;    }  | 

