1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

Modernize Internalizer with for-range loop (NFC)

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266168
This commit is contained in:
Mehdi Amini 2016-04-13 05:25:12 +00:00
parent 3adbf4da8e
commit 8e5a215c2c

View File

@ -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