summaryrefslogtreecommitdiff
path: root/tools/lto
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-03-29 03:34:57 +0000
committerBill Wendling <isanbard@gmail.com>2012-03-29 03:34:57 +0000
commit9f3b483b814efb536d1ad391e664443333d14179 (patch)
treedd02dae618d7116fc80131b9300bf64f44afb4ea /tools/lto
parentf75f4271f43ddff0be588fe3bf782de61d36e034 (diff)
downloadllvm-9f3b483b814efb536d1ad391e664443333d14179.tar.gz
llvm-9f3b483b814efb536d1ad391e664443333d14179.tar.bz2
llvm-9f3b483b814efb536d1ad391e664443333d14179.tar.xz
Cache the end() iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153632 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lto')
-rw-r--r--tools/lto/LTOModule.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/lto/LTOModule.cpp b/tools/lto/LTOModule.cpp
index 9c35fa0074..1c06f27283 100644
--- a/tools/lto/LTOModule.cpp
+++ b/tools/lto/LTOModule.cpp
@@ -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) {