mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL: Use the best resilience expansion when lowering types
This is a large patch; I couldn't split it up further while still keeping things working. There are four things being changed at once here: - Places that call SILType::isAddressOnly()/isLoadable() now call the SILFunction overload and not the SILModule one. - SILFunction's overloads of getTypeLowering() and getLoweredType() now pass the function's resilience expansion down, instead of hardcoding ResilienceExpansion::Minimal. - Various other places with '// FIXME: Expansion' now use a better resilience expansion. - A few tests were updated to reflect SILGen's improved code generation, and some new tests are added to cover more code paths that previously were uncovered and only manifested themselves as standard library build failures while I was working on this change.
This commit is contained in:
@@ -88,7 +88,7 @@ static RValue emitImplicitValueConstructorArg(SILGenFunction &SGF,
|
||||
|
||||
// This can happen if the value is resilient in the calling convention
|
||||
// but not resilient locally.
|
||||
if (argType.isLoadable(SGF.SGM.M) && argType.isAddress()) {
|
||||
if (argType.isLoadable(SGF.F) && argType.isAddress()) {
|
||||
if (mvArg.isPlusOne(SGF))
|
||||
mvArg = SGF.B.createLoadTake(loc, mvArg);
|
||||
else
|
||||
@@ -140,7 +140,7 @@ static void emitImplicitValueConstructor(SILGenFunction &SGF,
|
||||
|
||||
// Emit the indirect return argument, if any.
|
||||
SILValue resultSlot;
|
||||
if (selfTy.isAddressOnly(SGF.SGM.M) && SGF.silConv.useLoweredAddresses()) {
|
||||
if (SILModuleConventions::isReturnedIndirectlyInSIL(selfTy, SGF.SGM.M)) {
|
||||
auto &AC = SGF.getASTContext();
|
||||
auto VD = new (AC) ParamDecl(VarDecl::Specifier::InOut,
|
||||
SourceLoc(), SourceLoc(),
|
||||
|
||||
Reference in New Issue
Block a user