Skip to content

Commit ad230a0

Browse files
committed
IRGen: Remove some InOutType usages
1 parent 6926fde commit ad230a0

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/IRGen/GenFunc.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -642,11 +642,13 @@ static bool isABIIgnoredParameterWithoutStorage(IRGenModule &IGM,
642642
CanSILFunctionType substType,
643643
unsigned paramIdx) {
644644
auto param = substType->getParameters()[paramIdx];
645+
if (param.isFormalIndirect())
646+
return false;
647+
645648
SILType argType = IGM.silConv.getSILType(param);
646-
auto argLoweringTy = getArgumentLoweringType(argType.getASTType(), param);
647-
auto &ti = IGF.getTypeInfoForLowered(argLoweringTy);
649+
auto &ti = IGF.getTypeInfoForLowered(argType.getASTType());
648650
// Empty values don't matter.
649-
return ti.getSchema().empty() && !param.isFormalIndirect();
651+
return ti.getSchema().empty();
650652
}
651653

652654
/// Find the parameter index for the one (assuming there was only one) partially

lib/IRGen/GenProto.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2799,6 +2799,8 @@ void NecessaryBindings::save(IRGenFunction &IGF, Address buffer) const {
27992799
}
28002800

28012801
void NecessaryBindings::addTypeMetadata(CanType type) {
2802+
assert(!isa<InOutType>(type));
2803+
28022804
// Bindings are only necessary at all if the type is dependent.
28032805
if (!type->hasArchetype()) return;
28042806

@@ -2819,10 +2821,6 @@ void NecessaryBindings::addTypeMetadata(CanType type) {
28192821
addTypeMetadata(fn.getResult());
28202822
return;
28212823
}
2822-
if (auto inout = dyn_cast<InOutType>(type)) {
2823-
addTypeMetadata(inout.getObjectType());
2824-
return;
2825-
}
28262824
if (auto metatype = dyn_cast<MetatypeType>(type)) {
28272825
addTypeMetadata(metatype.getInstanceType());
28282826
return;

0 commit comments

Comments
 (0)