1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

Cache the end() iterator.

llvm-svn: 153632
This commit is contained in:
Bill Wendling 2012-03-29 03:34:57 +00:00
parent 32f97db4b2
commit 21b86c9017

View File

@ -666,7 +666,7 @@ static bool isDeclaration(const GlobalValue &V) {
/// 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 @@ bool LTOModule::parseSymbols(std::string &errMsg) {
}
// 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) {