Unify the error messages for the various tools when `verifyModule()`
fails on an input module. The "brave new way" is:
lltool: path/to/input.ll: error: input module is broken!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233667
91177308-0d34-0410-b5e6-
96231b3b80d8
; RUN: not llvm-link -o /dev/null %s 2>&1 | FileCheck %s
-; CHECK: input module '{{.*}}broken.ll' is broken
+; CHECK: broken.ll: error: input module is broken!
define i32 @foo(i32 %v) {
%first = add i32 %v, %second
%second = add i32 %v, 3
}
if (verifyModule(*Result, &errs())) {
- errs() << "bugpoint: " << Filename << ": error: does not verify\n";
+ errs() << "bugpoint: " << Filename << ": error: input module is broken!\n";
return std::unique_ptr<Module>();
}
// called on any passes.
if (!NoVerify && verifyModule(*M, &errs())) {
errs() << argv[0] << ": " << InputFilename
- << ": error: does not verify\n";
+ << ": error: input module is broken!\n";
return 1;
}
return 1;
}
- if (verifyModule(*M)) {
- errs() << argv[0] << ": input module '" << InputFilenames[i]
- << "' is broken!\n";
+ if (verifyModule(*M, &errs())) {
+ errs() << argv[0] << ": " << InputFilenames[i]
+ << ": error: input module is broken!\n";
return 1;
}
return 1;
}
- if (verifyModule(*Composite)) {
- errs() << argv[0] << ": linked module is broken!\n";
+ if (verifyModule(*Composite, &errs())) {
+ errs() << argv[0] << ": error: linked module is broken!\n";
return 1;
}
// pass pipelines. Otherwise we can crash on broken code during
// doInitialization().
if (!NoVerify && verifyModule(*M, &errs())) {
- errs() << argv[0] << ": " << InputFilename << ": error: does not verify\n";
+ errs() << argv[0] << ": " << InputFilename
+ << ": error: input module is broken!\n";
return 1;
}
Err.print(argv[0], errs());
return 1;
}
- if (verifyModule(*M, &errs()))
- report_fatal_error("verification failed");
+ if (verifyModule(*M, &errs())) {
+ errs() << argv[0] << ": " << InputFilename
+ << ": error: input module is broken!\n";
+ return 1;
+ }
errs() << "*** verify-use-list-order ***\n";
// Can't verify if order isn't preserved.