summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-extract/llvm-extract.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-11-01 16:46:18 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-11-01 16:46:18 +0000
commit246c4fb5d91c638b337635821c7d792fe633d602 (patch)
treebc5419a4749d4415b7e5a3aa052a38f763cf14bc /llvm/tools/llvm-extract/llvm-extract.cpp
parenta017974b9aaef2e959f75c644b8b15189e81b3f8 (diff)
downloadbcm5719-llvm-246c4fb5d91c638b337635821c7d792fe633d602.tar.gz
bcm5719-llvm-246c4fb5d91c638b337635821c7d792fe633d602.zip
Remove redundant calls to isMaterializable.
This removes calls to isMaterializable in the following cases: * It was redundant with a call to isDeclaration now that isDeclaration returns the correct answer for materializable functions. * It was followed by a call to Materialize. Just call Materialize and check EC. llvm-svn: 221050
Diffstat (limited to 'llvm/tools/llvm-extract/llvm-extract.cpp')
-rw-r--r--llvm/tools/llvm-extract/llvm-extract.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/tools/llvm-extract/llvm-extract.cpp b/llvm/tools/llvm-extract/llvm-extract.cpp
index fe97a03c034..53b2f0d00f4 100644
--- a/llvm/tools/llvm-extract/llvm-extract.cpp
+++ b/llvm/tools/llvm-extract/llvm-extract.cpp
@@ -216,19 +216,16 @@ int main(int argc, char **argv) {
if (!DeleteFn)
for (size_t i = 0, e = GVs.size(); i != e; ++i) {
GlobalValue *GV = GVs[i];
- if (GV->isMaterializable()) {
- if (std::error_code EC = GV->materialize()) {
- errs() << argv[0] << ": error reading input: " << EC.message()
- << "\n";
- return 1;
- }
+ if (std::error_code EC = GV->materialize()) {
+ errs() << argv[0] << ": error reading input: " << EC.message() << "\n";
+ return 1;
}
}
else {
// Deleting. Materialize every GV that's *not* in GVs.
SmallPtrSet<GlobalValue *, 8> GVSet(GVs.begin(), GVs.end());
for (auto &G : M->globals()) {
- if (!GVSet.count(&G) && G.isMaterializable()) {
+ if (!GVSet.count(&G)) {
if (std::error_code EC = G.materialize()) {
errs() << argv[0] << ": error reading input: " << EC.message()
<< "\n";
@@ -237,7 +234,7 @@ int main(int argc, char **argv) {
}
}
for (auto &F : *M) {
- if (!GVSet.count(&F) && F.isMaterializable()) {
+ if (!GVSet.count(&F)) {
if (std::error_code EC = F.materialize()) {
errs() << argv[0] << ": error reading input: " << EC.message()
<< "\n";
OpenPOWER on IntegriCloud