aboutsummaryrefslogtreecommitdiffstats
path: root/utils/TableGen
diff options
context:
space:
mode:
Diffstat (limited to 'utils/TableGen')
-rw-r--r--utils/TableGen/TableGen.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/utils/TableGen/TableGen.cpp b/utils/TableGen/TableGen.cpp
index 15b3131..5c0f91a 100644
--- a/utils/TableGen/TableGen.cpp
+++ b/utils/TableGen/TableGen.cpp
@@ -478,12 +478,19 @@ int main(int argc, char **argv) {
return 1;
}
} catch (const std::string &Error) {
- std::cerr << Error << "\n";
+ std::cerr << argv[0] << ": " << Error << "\n";
if (Out != &std::cout) {
delete Out; // Close the file
std::remove(OutputFilename.c_str()); // Remove the file, it's broken
}
return 1;
+ } catch (...) {
+ std::cerr << argv[0] << ": Unknown unexpected exception occurred.\n";
+ if (Out != &std::cout) {
+ delete Out; // Close the file
+ std::remove(OutputFilename.c_str()); // Remove the file, it's broken
+ }
+ return 2;
}
if (Out != &std::cout) {