Make tblgen's exception handling a little more robust by printing the

program name and also catching ...

llvm-svn: 16160
This commit is contained in:
Reid Spencer 2004-09-03 23:17:54 +00:00
parent f68090d67f
commit c8ec13388b
1 changed files with 8 additions and 1 deletions

View File

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