SIL: Use better type lowering APIs in a couple of spots

This commit is contained in:
Slava Pestov
2019-03-05 15:05:06 -05:00
parent bb97dbf243
commit 5847e163c1
12 changed files with 55 additions and 48 deletions

View File

@@ -452,8 +452,8 @@ static bool rewriteAllocBoxAsAllocStack(AllocBoxInst *ABI) {
assert(ABI->getBoxType()->getLayout()->getFields().size() == 1
&& "promoting multi-field box not implemented");
auto &Lowering = ABI->getModule()
.getTypeLowering(ABI->getBoxType()->getFieldType(ABI->getModule(), 0));
auto &Lowering = ABI->getFunction()
->getTypeLowering(ABI->getBoxType()->getFieldType(ABI->getModule(), 0));
auto Loc = CleanupLocation::get(ABI->getLoc());
for (auto LastRelease : FinalReleases) {