[llvm] r233667 - tools: Unify how verifyModule() is called
Duncan P. N. Exon Smith
dexonsmith at apple.com
Mon Mar 30 20:07:23 PDT 2015
Author: dexonsmith
Date: Mon Mar 30 22:07:23 2015
New Revision: 233667
URL: http://llvm.org/viewvc/llvm-project?rev=233667&view=rev
Log:
tools: Unify how verifyModule() is called
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!
Modified:
llvm/trunk/test/Linker/broken.ll
llvm/trunk/tools/bugpoint/BugDriver.cpp
llvm/trunk/tools/llc/llc.cpp
llvm/trunk/tools/llvm-link/llvm-link.cpp
llvm/trunk/tools/opt/opt.cpp
llvm/trunk/tools/verify-uselistorder/verify-uselistorder.cpp
Modified: llvm/trunk/test/Linker/broken.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Linker/broken.ll?rev=233667&r1=233666&r2=233667&view=diff
==============================================================================
--- llvm/trunk/test/Linker/broken.ll (original)
+++ llvm/trunk/test/Linker/broken.ll Mon Mar 30 22:07:23 2015
@@ -1,6 +1,6 @@
; 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
Modified: llvm/trunk/tools/bugpoint/BugDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.cpp?rev=233667&r1=233666&r2=233667&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/BugDriver.cpp (original)
+++ llvm/trunk/tools/bugpoint/BugDriver.cpp Mon Mar 30 22:07:23 2015
@@ -93,7 +93,7 @@ std::unique_ptr<Module> llvm::parseInput
}
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>();
}
Modified: llvm/trunk/tools/llc/llc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=233667&r1=233666&r2=233667&view=diff
==============================================================================
--- llvm/trunk/tools/llc/llc.cpp (original)
+++ llvm/trunk/tools/llc/llc.cpp Mon Mar 30 22:07:23 2015
@@ -230,7 +230,7 @@ static int compileModule(char **argv, LL
// 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;
}
Modified: llvm/trunk/tools/llvm-link/llvm-link.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-link/llvm-link.cpp?rev=233667&r1=233666&r2=233667&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-link/llvm-link.cpp (original)
+++ llvm/trunk/tools/llvm-link/llvm-link.cpp Mon Mar 30 22:07:23 2015
@@ -116,9 +116,9 @@ int main(int argc, char **argv) {
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;
}
@@ -137,8 +137,8 @@ int main(int argc, char **argv) {
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;
}
Modified: llvm/trunk/tools/opt/opt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=233667&r1=233666&r2=233667&view=diff
==============================================================================
--- llvm/trunk/tools/opt/opt.cpp (original)
+++ llvm/trunk/tools/opt/opt.cpp Mon Mar 30 22:07:23 2015
@@ -354,7 +354,8 @@ int main(int argc, char **argv) {
// 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;
}
Modified: llvm/trunk/tools/verify-uselistorder/verify-uselistorder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/verify-uselistorder/verify-uselistorder.cpp?rev=233667&r1=233666&r2=233667&view=diff
==============================================================================
--- llvm/trunk/tools/verify-uselistorder/verify-uselistorder.cpp (original)
+++ llvm/trunk/tools/verify-uselistorder/verify-uselistorder.cpp Mon Mar 30 22:07:23 2015
@@ -534,8 +534,11 @@ int main(int argc, char **argv) {
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.
More information about the llvm-commits
mailing list