summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/LegacyPassManager.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-11-09 17:49:19 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-11-09 17:49:19 +0000
commit7f00d0a125b98a1c68b05e7b6be4e89f39bf8240 (patch)
treeb13eb173d29b968498f03be9eceaf03f58752d76 /llvm/lib/IR/LegacyPassManager.cpp
parent9934c54cca1bc94e02f58c3fe1209e72312c115b (diff)
downloadbcm5719-llvm-7f00d0a125b98a1c68b05e7b6be4e89f39bf8240.tar.gz
bcm5719-llvm-7f00d0a125b98a1c68b05e7b6be4e89f39bf8240.zip
Bitcode: Change the materializer interface to return llvm::Error.
Differential Revision: https://reviews.llvm.org/D26439 llvm-svn: 286382
Diffstat (limited to 'llvm/lib/IR/LegacyPassManager.cpp')
-rw-r--r--llvm/lib/IR/LegacyPassManager.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/IR/LegacyPassManager.cpp b/llvm/lib/IR/LegacyPassManager.cpp
index d5b2ef6d03b..458aeb8a38f 100644
--- a/llvm/lib/IR/LegacyPassManager.cpp
+++ b/llvm/lib/IR/LegacyPassManager.cpp
@@ -20,6 +20,7 @@
#include "llvm/Support/Chrono.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/Error.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Mutex.h"
@@ -1377,8 +1378,9 @@ void FunctionPassManager::add(Pass *P) {
/// so, return true.
///
bool FunctionPassManager::run(Function &F) {
- if (std::error_code EC = F.materialize())
- report_fatal_error("Error reading bitcode file: " + EC.message());
+ handleAllErrors(F.materialize(), [&](ErrorInfoBase &EIB) {
+ report_fatal_error("Error reading bitcode file: " + EIB.message());
+ });
return FPM->run(F);
}
OpenPOWER on IntegriCloud