diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-09-03 23:17:54 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-09-03 23:17:54 +0000 |
commit | 23f7d5131cf9519b90ac4fc2d200671d128b5464 (patch) | |
tree | ef35b36aa2b6345f3deebec687ae857acc4c6893 /utils/TableGen | |
parent | a3b4e09715f2c65c54e7a875bba01345da8e3914 (diff) | |
download | external_llvm-23f7d5131cf9519b90ac4fc2d200671d128b5464.zip external_llvm-23f7d5131cf9519b90ac4fc2d200671d128b5464.tar.gz external_llvm-23f7d5131cf9519b90ac4fc2d200671d128b5464.tar.bz2 |
Make tblgen's exception handling a little more robust by printing the
program name and also catching ...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16160 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r-- | utils/TableGen/TableGen.cpp | 9 |
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) { |