mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-09 22:13:07 +00:00
Modernize Internalizer with for-range loop (NFC)
From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266168 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8fbafc9f4e
commit
42ab0ff659
@ -275,23 +275,21 @@ bool Internalizer::internalizeModule(Module &M, CallGraph *CG) {
|
||||
|
||||
// Mark all global variables with initializers that are not in the api as
|
||||
// internal as well.
|
||||
for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E;
|
||||
++I) {
|
||||
if (!maybeInternalize(*I, ExternalComdats))
|
||||
for (auto &GV : M.globals()) {
|
||||
if (!maybeInternalize(GV, ExternalComdats))
|
||||
continue;
|
||||
|
||||
++NumGlobals;
|
||||
DEBUG(dbgs() << "Internalized gvar " << I->getName() << "\n");
|
||||
DEBUG(dbgs() << "Internalized gvar " << GV.getName() << "\n");
|
||||
}
|
||||
|
||||
// Mark all aliases that are not in the api as internal as well.
|
||||
for (Module::alias_iterator I = M.alias_begin(), E = M.alias_end(); I != E;
|
||||
++I) {
|
||||
if (!maybeInternalize(*I, ExternalComdats))
|
||||
for (auto &GA : M.aliases()) {
|
||||
if (!maybeInternalize(GA, ExternalComdats))
|
||||
continue;
|
||||
|
||||
++NumAliases;
|
||||
DEBUG(dbgs() << "Internalized alias " << I->getName() << "\n");
|
||||
DEBUG(dbgs() << "Internalized alias " << GA.getName() << "\n");
|
||||
}
|
||||
|
||||
// We do not keep track of whether this pass changed the module because
|
||||
|
Loading…
x
Reference in New Issue
Block a user