diff options
author | Chris Lattner <sabre@nondot.org> | 2006-07-06 18:02:27 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-07-06 18:02:27 +0000 |
commit | 5734e8d7c38778e6e0575f80353ba8327b412947 (patch) | |
tree | eb8fa69520bb8884e7f63acc2b4874154239a877 /llvm/tools/llvm2cpp/llvm2cpp.cpp | |
parent | 6cf27be54da3d601a6a6148984a98c280bb2dbc3 (diff) | |
download | bcm5719-llvm-5734e8d7c38778e6e0575f80353ba8327b412947.tar.gz bcm5719-llvm-5734e8d7c38778e6e0575f80353ba8327b412947.zip |
Change the verifier to never throw an exception. Instead verifyModule canoptionally return the string error, which is an easier api for clients touse anyway.
llvm-svn: 29017
Diffstat (limited to 'llvm/tools/llvm2cpp/llvm2cpp.cpp')
-rw-r--r-- | llvm/tools/llvm2cpp/llvm2cpp.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/llvm/tools/llvm2cpp/llvm2cpp.cpp b/llvm/tools/llvm2cpp/llvm2cpp.cpp index 9035e71c075..7e322dbef81 100644 --- a/llvm/tools/llvm2cpp/llvm2cpp.cpp +++ b/llvm/tools/llvm2cpp/llvm2cpp.cpp @@ -59,14 +59,16 @@ int main(int argc, char **argv) { return 1; } - try { - if (!DisableVerify) - verifyModule(*M.get(), ThrowExceptionAction); - } catch (const std::string &Err) { - std::cerr << argv[0] - << ": assembly parsed, but does not verify as correct!\n"; - std::cerr << Err; - return 1; + // FIXME: llvm2cpp should read .bc files and thus not run the verifier + // explicitly! + if (!DisableVerify) { + std::string Err; + if (verifyModule(*M.get(), ReturnStatusAction, &Err)) { + std::cerr << argv[0] + << ": assembly parsed, but does not verify as correct!\n"; + std::cerr << Err; + return 1; + } } if (OutputFilename != "") { // Specified an output filename? |