summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-31 03:07:23 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-31 03:07:23 +0000
commit4628282face59b60d124b5289bb134e15525ce0e (patch)
tree2707fde5deb9051b8b743826bdd4939dd5e21f91 /llvm/tools
parent1819953db52c8e5bc7790d3dd20ad342bf77a161 (diff)
downloadbcm5719-llvm-4628282face59b60d124b5289bb134e15525ce0e.tar.gz
bcm5719-llvm-4628282face59b60d124b5289bb134e15525ce0e.zip
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! llvm-svn: 233667
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/bugpoint/BugDriver.cpp2
-rw-r--r--llvm/tools/llc/llc.cpp2
-rw-r--r--llvm/tools/llvm-link/llvm-link.cpp10
-rw-r--r--llvm/tools/opt/opt.cpp3
-rw-r--r--llvm/tools/verify-uselistorder/verify-uselistorder.cpp7
5 files changed, 14 insertions, 10 deletions
diff --git a/llvm/tools/bugpoint/BugDriver.cpp b/llvm/tools/bugpoint/BugDriver.cpp
index 865cb513c55..43f4c2963fc 100644
--- a/llvm/tools/bugpoint/BugDriver.cpp
+++ b/llvm/tools/bugpoint/BugDriver.cpp
@@ -93,7 +93,7 @@ std::unique_ptr<Module> llvm::parseInputFile(StringRef Filename,
}
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>();
}
diff --git a/llvm/tools/llc/llc.cpp b/llvm/tools/llc/llc.cpp
index fa8d2688dd2..000948c10a0 100644
--- a/llvm/tools/llc/llc.cpp
+++ b/llvm/tools/llc/llc.cpp
@@ -230,7 +230,7 @@ static int compileModule(char **argv, LLVMContext &Context) {
// 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;
}
diff --git a/llvm/tools/llvm-link/llvm-link.cpp b/llvm/tools/llvm-link/llvm-link.cpp
index 29c4c736b33..6924aa5cb2e 100644
--- a/llvm/tools/llvm-link/llvm-link.cpp
+++ b/llvm/tools/llvm-link/llvm-link.cpp
@@ -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;
}
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index 86fbed70036..c64e907af22 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/tools/opt/opt.cpp
@@ -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;
}
diff --git a/llvm/tools/verify-uselistorder/verify-uselistorder.cpp b/llvm/tools/verify-uselistorder/verify-uselistorder.cpp
index ef3d5b39253..09931587470 100644
--- a/llvm/tools/verify-uselistorder/verify-uselistorder.cpp
+++ b/llvm/tools/verify-uselistorder/verify-uselistorder.cpp
@@ -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.
OpenPOWER on IntegriCloud