summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-extract/llvm-extract.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-10-24 22:50:48 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-10-24 22:50:48 +0000
commit5a52e6dc9eeb07e44a62bdc828bc9b8b7348549d (patch)
treed103373d61ab3a674d71ed65a5758610bf5a6482 /llvm/tools/llvm-extract/llvm-extract.cpp
parent2813f496d98f3e6d2c9c2774601999e147af34ef (diff)
downloadbcm5719-llvm-5a52e6dc9eeb07e44a62bdc828bc9b8b7348549d.tar.gz
bcm5719-llvm-5a52e6dc9eeb07e44a62bdc828bc9b8b7348549d.zip
Modernize the error handling of the Materialize function.
llvm-svn: 220600
Diffstat (limited to 'llvm/tools/llvm-extract/llvm-extract.cpp')
-rw-r--r--llvm/tools/llvm-extract/llvm-extract.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/llvm/tools/llvm-extract/llvm-extract.cpp b/llvm/tools/llvm-extract/llvm-extract.cpp
index 116b678e07e..fe97a03c034 100644
--- a/llvm/tools/llvm-extract/llvm-extract.cpp
+++ b/llvm/tools/llvm-extract/llvm-extract.cpp
@@ -217,9 +217,9 @@ int main(int argc, char **argv) {
for (size_t i = 0, e = GVs.size(); i != e; ++i) {
GlobalValue *GV = GVs[i];
if (GV->isMaterializable()) {
- std::string ErrInfo;
- if (GV->Materialize(&ErrInfo)) {
- errs() << argv[0] << ": error reading input: " << ErrInfo << "\n";
+ if (std::error_code EC = GV->materialize()) {
+ errs() << argv[0] << ": error reading input: " << EC.message()
+ << "\n";
return 1;
}
}
@@ -229,18 +229,18 @@ int main(int argc, char **argv) {
SmallPtrSet<GlobalValue *, 8> GVSet(GVs.begin(), GVs.end());
for (auto &G : M->globals()) {
if (!GVSet.count(&G) && G.isMaterializable()) {
- std::string ErrInfo;
- if (G.Materialize(&ErrInfo)) {
- errs() << argv[0] << ": error reading input: " << ErrInfo << "\n";
+ if (std::error_code EC = G.materialize()) {
+ errs() << argv[0] << ": error reading input: " << EC.message()
+ << "\n";
return 1;
}
}
}
for (auto &F : *M) {
if (!GVSet.count(&F) && F.isMaterializable()) {
- std::string ErrInfo;
- if (F.Materialize(&ErrInfo)) {
- errs() << argv[0] << ": error reading input: " << ErrInfo << "\n";
+ if (std::error_code EC = F.materialize()) {
+ errs() << argv[0] << ": error reading input: " << EC.message()
+ << "\n";
return 1;
}
}
OpenPOWER on IntegriCloud