diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-11-28 16:26:14 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-11-28 16:26:14 +0000 |
| commit | 3d0974105a8583fdb16e6b7c911f864a8848f962 (patch) | |
| tree | da1a4dfe73a21a9d8a7ddf987845722b6dac851f /llvm/lib | |
| parent | 93cd657cf075796b43f82582a3c951ae91db5279 (diff) | |
| download | bcm5719-llvm-3d0974105a8583fdb16e6b7c911f864a8848f962.tar.gz bcm5719-llvm-3d0974105a8583fdb16e6b7c911f864a8848f962.zip | |
Add an assert and use a range loop. NFC.
llvm-svn: 222922
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Linker/LinkModules.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Linker/LinkModules.cpp b/llvm/lib/Linker/LinkModules.cpp index f1f4a51f78c..d3cb78c6997 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(); } |

