[llvm-commits] [llvm] r153632 - /llvm/trunk/tools/lto/LTOModule.cpp
Bill Wendling
isanbard at gmail.com
Wed Mar 28 20:34:58 PDT 2012
Author: void
Date: Wed Mar 28 22:34:57 2012
New Revision: 153632
URL: http://llvm.org/viewvc/llvm-project?rev=153632&view=rev
Log:
Cache the end() iterator.
Modified:
llvm/trunk/tools/lto/LTOModule.cpp
Modified: llvm/trunk/tools/lto/LTOModule.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOModule.cpp?rev=153632&r1=153631&r2=153632&view=diff
==============================================================================
--- llvm/trunk/tools/lto/LTOModule.cpp (original)
+++ llvm/trunk/tools/lto/LTOModule.cpp Wed Mar 28 22:34:57 2012
@@ -666,7 +666,7 @@
/// them to either the defined or undefined lists.
bool LTOModule::parseSymbols(std::string &errMsg) {
// add functions
- for (Module::iterator f = _module->begin(); f != _module->end(); ++f) {
+ for (Module::iterator f = _module->begin(), e = _module->end(); f != e; ++f) {
if (isDeclaration(*f))
addPotentialUndefinedSymbol(f);
else
@@ -697,8 +697,8 @@
}
// make symbols for all undefines
- for (StringMap<NameAndAttributes>::iterator it=_undefines.begin();
- it != _undefines.end(); ++it) {
+ for (StringMap<NameAndAttributes>::iterator it=_undefines.begin(),
+ e = _undefines.end(); it != e; ++it) {
// if this symbol also has a definition, then don't make an undefine
// because it is a tentative definition
if (_defines.count(it->getKey()) == 0) {
More information about the llvm-commits
mailing list