Skip to content

Commit

Permalink
C++11 Rangify loops in AssemblyWriter::printModule, NFC.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239686 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
yrnkrn committed Jun 13, 2015
1 parent 803fe19 commit 09eacc1
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions lib/IR/AsmWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2169,23 +2169,21 @@ void AssemblyWriter::printModule(const Module *M) {

// Output all globals.
if (!M->global_empty()) Out << '\n';
for (Module::const_global_iterator I = M->global_begin(), E = M->global_end();
I != E; ++I) {
printGlobal(I); Out << '\n';
for (const GlobalVariable &GV : M->globals()) {
printGlobal(&GV); Out << '\n';
}

// Output all aliases.
if (!M->alias_empty()) Out << "\n";
for (Module::const_alias_iterator I = M->alias_begin(), E = M->alias_end();
I != E; ++I)
printAlias(I);
for (const GlobalAlias &GA : M->aliases())
printAlias(&GA);

// Output global use-lists.
printUseLists(nullptr);

// Output all of the functions.
for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I)
printFunction(I);
for (const Function &F : *M)
printFunction(&F);
assert(UseListOrders.empty() && "All use-lists should have been consumed");

// Output all attribute groups.
Expand All @@ -2197,9 +2195,8 @@ void AssemblyWriter::printModule(const Module *M) {
// Output named metadata.
if (!M->named_metadata_empty()) Out << '\n';

for (Module::const_named_metadata_iterator I = M->named_metadata_begin(),
E = M->named_metadata_end(); I != E; ++I)
printNamedMDNode(I);
for (const NamedMDNode &Node : M->named_metadata())
printNamedMDNode(&Node);

// Output metadata.
if (!Machine.mdn_empty()) {
Expand Down

0 comments on commit 09eacc1

Please sign in to comment.