[llvm] r212278 - IR: cleanup Module::dropReferences
David Majnemer
david.majnemer at gmail.com
Thu Jul 3 09:12:55 PDT 2014
Author: majnemer
Date: Thu Jul 3 11:12:55 2014
New Revision: 212278
URL: http://llvm.org/viewvc/llvm-project?rev=212278&view=rev
Log:
IR: cleanup Module::dropReferences
This replaces some old-style loops with range-based for.
Modified:
llvm/trunk/lib/IR/Module.cpp
Modified: llvm/trunk/lib/IR/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Module.cpp?rev=212278&r1=212277&r2=212278&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Module.cpp (original)
+++ llvm/trunk/lib/IR/Module.cpp Thu Jul 3 11:12:55 2014
@@ -437,14 +437,14 @@ std::error_code Module::materializeAllPe
// has "dropped all references", except operator delete.
//
void Module::dropAllReferences() {
- for(Module::iterator I = begin(), E = end(); I != E; ++I)
- I->dropAllReferences();
+ for (Function &F : *this)
+ F.dropAllReferences();
- for(Module::global_iterator I = global_begin(), E = global_end(); I != E; ++I)
- I->dropAllReferences();
+ for (GlobalVariable &GV : globals())
+ GV.dropAllReferences();
- for(Module::alias_iterator I = alias_begin(), E = alias_end(); I != E; ++I)
- I->dropAllReferences();
+ for (GlobalAlias &GA : aliases())
+ GA.dropAllReferences();
}
unsigned Module::getDwarfVersion() const {
More information about the llvm-commits
mailing list