Make tablegen print out a nice error message for a const char*

exception, like it does for a std::string exception.

llvm-svn: 58865
This commit is contained in:
Dan Gohman 2008-11-07 21:01:13 +00:00
parent 47a6235491
commit cc0d2cfa01
1 changed files with 7 additions and 0 deletions

View File

@ -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()) {