mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
Add an assert and use a range loop. NFC.
llvm-svn: 222922
This commit is contained in:
parent
3962e8e2eb
commit
6128226dc5
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user