From: Rafael Espindola Date: Fri, 28 Nov 2014 16:26:14 +0000 (+0000) Subject: Add an assert and use a range loop. NFC. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d0974105a8583fdb16e6b7c911f864a8848f962;p=platform%2Fupstream%2Fllvm.git Add an assert and use a range loop. NFC. llvm-svn: 222922 --- diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index f1f4a51..d3cb78c 100644 --- a/llvm/lib/Linker/LinkModules.cpp +++ b/llvm/lib/Linker/LinkModules.cpp @@ -94,13 +94,15 @@ private: } void TypeMapTy::addTypeMapping(Type *DstTy, Type *SrcTy) { + assert(SpeculativeTypes.empty()); + // Check to see if these types are recursively isomorphic and establish a // mapping between them if so. if (!areTypesIsomorphic(DstTy, SrcTy)) { // Oops, they aren't isomorphic. Just discard this request by rolling out // any speculative mappings we've established. - for (unsigned i = 0, e = SpeculativeTypes.size(); i != e; ++i) - MappedTypes.erase(SpeculativeTypes[i]); + for (Type *Ty : SpeculativeTypes) + MappedTypes.erase(Ty); } SpeculativeTypes.clear(); }