diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-12-30 05:36:08 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-12-30 05:36:08 +0000 |
commit | 1ef8bdaedbd98bee35a573b8bc87149f2182cb5e (patch) | |
tree | dc21da7903997dfbcf6061f19b35a2a522c740b9 /tools/bugpoint/bugpoint.cpp | |
parent | c18671cdcd53df08cbeff7ecf443475f61971b9d (diff) |
For PR351:
* Place a try/catch block around the entire tool to Make sure std::string
exceptions are caught and printed before exiting the tool.
* Make sure we catch unhandled exceptions at the top level so that we don't
abort with a useless message but indicate than an unhandled exception was
generated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19192 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/bugpoint.cpp')
-rw-r--r-- | tools/bugpoint/bugpoint.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/bugpoint/bugpoint.cpp b/tools/bugpoint/bugpoint.cpp index ff26a37693..9e5b4c4e87 100644 --- a/tools/bugpoint/bugpoint.cpp +++ b/tools/bugpoint/bugpoint.cpp @@ -51,10 +51,11 @@ int main(int argc, char **argv) { return D.run(); } catch (ToolExecutionError &TEE) { std::cerr << "Tool execution error: " << TEE.what() << '\n'; - return 1; + } catch (const std::string& msg) { + std::cerr << argv[0] << ": " << msg << "\n"; } catch (...) { std::cerr << "Whoops, an exception leaked out of bugpoint. " << "This is a bug in bugpoint!\n"; - return 1; } + return 1; } |