mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-28 07:17:32 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221050 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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";
|
||||
|
Reference in New Issue
Block a user