mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Add an assert and use a range loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222922 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -94,13 +94,15 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void TypeMapTy::addTypeMapping(Type *DstTy, Type *SrcTy) {
|
void TypeMapTy::addTypeMapping(Type *DstTy, Type *SrcTy) {
|
||||||
|
assert(SpeculativeTypes.empty());
|
||||||
|
|
||||||
// Check to see if these types are recursively isomorphic and establish a
|
// Check to see if these types are recursively isomorphic and establish a
|
||||||
// mapping between them if so.
|
// mapping between them if so.
|
||||||
if (!areTypesIsomorphic(DstTy, SrcTy)) {
|
if (!areTypesIsomorphic(DstTy, SrcTy)) {
|
||||||
// Oops, they aren't isomorphic. Just discard this request by rolling out
|
// Oops, they aren't isomorphic. Just discard this request by rolling out
|
||||||
// any speculative mappings we've established.
|
// any speculative mappings we've established.
|
||||||
for (unsigned i = 0, e = SpeculativeTypes.size(); i != e; ++i)
|
for (Type *Ty : SpeculativeTypes)
|
||||||
MappedTypes.erase(SpeculativeTypes[i]);
|
MappedTypes.erase(Ty);
|
||||||
}
|
}
|
||||||
SpeculativeTypes.clear();
|
SpeculativeTypes.clear();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user