summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYaron Keren <yaron.keren@gmail.com>2015-06-13 17:50:47 +0000
committerYaron Keren <yaron.keren@gmail.com>2015-06-13 17:50:47 +0000
commitf3cf9d1f6e4c9091b5bfc34bf8211753814b2560 (patch)
treea1fbdb5dd7c83e3df66aebe00ab30dfb85083434
parenta0b4c565fddb8249488414fb8583c1f60578009b (diff)
downloadbcm5719-llvm-f3cf9d1f6e4c9091b5bfc34bf8211753814b2560.tar.gz
bcm5719-llvm-f3cf9d1f6e4c9091b5bfc34bf8211753814b2560.zip
C++11 Rangify loops in AssemblyWriter::printModule, NFC.
llvm-svn: 239686
-rw-r--r--llvm/lib/IR/AsmWriter.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp
index 0744fdf4015..dca2e7eb46d 100644
--- a/llvm/lib/IR/AsmWriter.cpp
+++ b/llvm/lib/IR/AsmWriter.cpp
@@ -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.
@@ -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()) {
OpenPOWER on IntegriCloud