Actually, use an exception to stop verification. This gives us much better

error messages because verification stops at the first error.

llvm-svn: 14794
This commit is contained in:
Chris Lattner 2004-07-13 08:48:04 +00:00
parent 2c1bc9e7e2
commit ab1aedab13
1 changed files with 5 additions and 1 deletions

View File

@ -57,9 +57,13 @@ int main(int argc, char **argv) {
return 1;
}
if (!DisableVerify && verifyModule(*M.get(), PrintMessageAction)) {
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;
}