Change the verifier to never throw an exception. Instead verifyModule canoptionally return the string error, which is an easier api for clients touse anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29017 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/llvm2cpp/llvm2cpp.cpp b/tools/llvm2cpp/llvm2cpp.cpp
index 9035e71..7e322db 100644
--- a/tools/llvm2cpp/llvm2cpp.cpp
+++ b/tools/llvm2cpp/llvm2cpp.cpp
@@ -59,14 +59,16 @@
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?