aboutsummaryrefslogtreecommitdiff
path: root/utils/TableGen/TableGen.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-11-07 21:01:13 +0000
committerDan Gohman <gohman@apple.com>2008-11-07 21:01:13 +0000
commit212e6983eb7f209d1308c2b489af7c483bda511e (patch)
treeaa788f9ac74f4f327ec03cf4b3abe2ce2cdb919b /utils/TableGen/TableGen.cpp
parentc4479a76b14eb7233878e8586ceb4d348b64ced4 (diff)
Make tablegen print out a nice error message for a const char*
exception, like it does for a std::string exception. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58865 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/TableGen.cpp')
-rw-r--r--utils/TableGen/TableGen.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/utils/TableGen/TableGen.cpp b/utils/TableGen/TableGen.cpp
index d6e84609f4..c6692f805b 100644
--- a/utils/TableGen/TableGen.cpp
+++ b/utils/TableGen/TableGen.cpp
@@ -212,6 +212,13 @@ int main(int argc, char **argv) {
std::remove(OutputFilename.c_str()); // Remove the file, it's broken
}
return 1;
+ } catch (const char *Error) {
+ cerr << argv[0] << ": " << Error << "\n";
+ if (Out != cout.stream()) {
+ delete Out; // Close the file
+ std::remove(OutputFilename.c_str()); // Remove the file, it's broken
+ }
+ return 1;
} catch (...) {
cerr << argv[0] << ": Unknown unexpected exception occurred.\n";
if (Out != cout.stream()) {