Skip to content

Commit 37e82a6

Browse files
committed
[NFC] getWitnessMethodConformanceOrNone -> getWitnessMethodConformanceOrInvalid
1 parent 3e1a61f commit 37e82a6

File tree

15 files changed

+38
-45
lines changed

15 files changed

+38
-45
lines changed

include/swift/AST/Types.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4104,7 +4104,7 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode,
41044104
/// If this is a @convention(witness_method) function, return the conformance
41054105
/// for which the method is a witness. If it isn't that convention, return
41064106
/// an invalid conformance.
4107-
ProtocolConformanceRef getWitnessMethodConformanceOrNone() const {
4107+
ProtocolConformanceRef getWitnessMethodConformanceOrInvalid() const {
41084108
return WitnessMethodConformance;
41094109
}
41104110

@@ -4199,11 +4199,9 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode,
41994199

42004200
void Profile(llvm::FoldingSetNodeID &ID) {
42014201
Profile(ID, getSubstGenericSignature(), getExtInfo(), getCoroutineKind(),
4202-
getCalleeConvention(), getParameters(), getYields(),
4203-
getResults(), getOptionalErrorResult(),
4204-
getWitnessMethodConformanceOrNone(),
4205-
isGenericSignatureImplied(),
4206-
getSubstitutions());
4202+
getCalleeConvention(), getParameters(), getYields(), getResults(),
4203+
getOptionalErrorResult(), getWitnessMethodConformanceOrInvalid(),
4204+
isGenericSignatureImplied(), getSubstitutions());
42074205
}
42084206
static void
42094207
Profile(llvm::FoldingSetNodeID &ID, GenericSignature genericSig, ExtInfo info,

lib/AST/ASTPrinter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4000,7 +4000,7 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
40004000
void visitSILFunctionType(SILFunctionType *T) {
40014001
printSILCoroutineKind(T->getCoroutineKind());
40024002
printFunctionExtInfo(T->getExtInfo(),
4003-
T->getWitnessMethodConformanceOrNone());
4003+
T->getWitnessMethodConformanceOrInvalid());
40044004
printCalleeConvention(T->getCalleeConvention());
40054005
if (auto sig = T->getSubstGenericSignature()) {
40064006
printGenericSignature(sig,

lib/IRGen/GenProto.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ bool PolymorphicConvention::considerType(CanType type, IsExact_t isExact,
323323

324324
void PolymorphicConvention::considerWitnessSelf(CanSILFunctionType fnType) {
325325
CanType selfTy = fnType->getSelfInstanceType(IGM.getSILModule());
326-
auto conformance = fnType->getWitnessMethodConformanceOrNone();
326+
auto conformance = fnType->getWitnessMethodConformanceOrInvalid();
327327

328328
// First, bind type metadata for Self.
329329
Sources.emplace_back(MetadataSource::Kind::SelfMetadata,
@@ -564,7 +564,7 @@ void EmitPolymorphicParameters::bindExtraSource(const MetadataSource &source,
564564
assert(selfTable && "no Self witness table for witness method");
565565

566566
// Mark this as the cached witness table for Self.
567-
auto conformance = FnType->getWitnessMethodConformanceOrNone();
567+
auto conformance = FnType->getWitnessMethodConformanceOrInvalid();
568568
auto selfProto = conformance.getRequirement();
569569

570570
auto selfTy = FnType->getSelfInstanceType(IGM.getSILModule());

lib/IRGen/IRGenSIL.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2123,7 +2123,8 @@ emitWitnessTableForLoweredCallee(IRGenSILFunction &IGF,
21232123
// This use of getSelfInstanceType() assumes that the instance type is
21242124
// always a meaningful formal type.
21252125
auto substSelfType = substCalleeType->getSelfInstanceType(IGF.IGM.getSILModule());
2126-
auto substConformance = substCalleeType->getWitnessMethodConformanceOrNone();
2126+
auto substConformance =
2127+
substCalleeType->getWitnessMethodConformanceOrInvalid();
21272128

21282129
llvm::Value *argMetadata = IGF.emitTypeMetadataRef(substSelfType);
21292130
llvm::Value *wtable =

lib/IRGen/LoadableByAddress.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ LargeSILTypeMapper::getNewSILFunctionType(GenericEnvironment *env,
286286
fnType->getSubstitutions(),
287287
fnType->isGenericSignatureImplied(),
288288
fnType->getASTContext(),
289-
fnType->getWitnessMethodConformanceOrNone());
289+
fnType->getWitnessMethodConformanceOrInvalid());
290290
return newFnType;
291291
}
292292

@@ -2317,7 +2317,7 @@ static bool rewriteFunctionReturn(StructLoweringState &pass) {
23172317
newSILResultInfo, loweredTy->getOptionalErrorResult(),
23182318
loweredTy->getSubstitutions(), loweredTy->isGenericSignatureImplied(),
23192319
F->getModule().getASTContext(),
2320-
loweredTy->getWitnessMethodConformanceOrNone());
2320+
loweredTy->getWitnessMethodConformanceOrInvalid());
23212321
F->rewriteLoweredTypeUnsafe(NewTy);
23222322
return true;
23232323
}

lib/SIL/SILFunctionType.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ Lowering::adjustFunctionType(CanSILFunctionType type,
214214
ParameterConvention callee,
215215
ProtocolConformanceRef witnessMethodConformance) {
216216
if (type->getExtInfo() == extInfo && type->getCalleeConvention() == callee &&
217-
type->getWitnessMethodConformanceOrNone() == witnessMethodConformance)
217+
type->getWitnessMethodConformanceOrInvalid() == witnessMethodConformance)
218218
return type;
219219

220220
return SILFunctionType::get(type->getSubstGenericSignature(),
@@ -246,11 +246,10 @@ CanSILFunctionType SILFunctionType::getWithExtInfo(ExtInfo newExt) {
246246
: ParameterConvention::Direct_Unowned);
247247

248248
return get(getSubstGenericSignature(), newExt, getCoroutineKind(),
249-
calleeConvention, getParameters(), getYields(),
250-
getResults(), getOptionalErrorResult(),
251-
getSubstitutions(), isGenericSignatureImplied(),
252-
getASTContext(),
253-
getWitnessMethodConformanceOrNone());
249+
calleeConvention, getParameters(), getYields(), getResults(),
250+
getOptionalErrorResult(), getSubstitutions(),
251+
isGenericSignatureImplied(), getASTContext(),
252+
getWitnessMethodConformanceOrInvalid());
254253
}
255254

256255
namespace {
@@ -2424,7 +2423,7 @@ class SILTypeSubstituter :
24242423
}
24252424

24262425
auto witnessMethodConformance = ProtocolConformanceRef::forInvalid();
2427-
auto conformance = origType->getWitnessMethodConformanceOrNone();
2426+
auto conformance = origType->getWitnessMethodConformanceOrInvalid();
24282427
if (!conformance.isInvalid()) {
24292428
assert(origType->getExtInfo().hasSelfParam());
24302429
auto selfType = origType->getSelfParameter().getInterfaceType();

lib/SILGen/SILGenBridging.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ SILGenFunction::emitBlockToFunc(SILLocation loc,
927927

928928
auto loweredFuncTyWithoutNoEscape = adjustFunctionType(
929929
loweredFuncTy, loweredFuncTy->getExtInfo().withNoEscape(false),
930-
loweredFuncTy->getWitnessMethodConformanceOrNone());
930+
loweredFuncTy->getWitnessMethodConformanceOrInvalid());
931931

932932
CanType dynamicSelfType;
933933
auto thunkTy = buildThunkType(loweredBlockTy, loweredFuncTyWithoutNoEscape,

lib/SILGen/SILGenPoly.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3385,7 +3385,7 @@ ManagedValue Transform::transformFunction(ManagedValue fn,
33853385
: expectedFnType->isNoEscape());
33863386
auto newFnType =
33873387
adjustFunctionType(expectedFnType, newEI, fnType->getCalleeConvention(),
3388-
fnType->getWitnessMethodConformanceOrNone());
3388+
fnType->getWitnessMethodConformanceOrInvalid());
33893389

33903390
// Apply any ABI-compatible conversions before doing thin-to-thick or
33913391
// escaping->noescape conversion.

lib/SILOptimizer/FunctionSignatureTransforms/ExistentialTransform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ ExistentialTransform::createExistentialSpecializedFunctionType() {
362362
/// Finally the ExtInfo.
363363
auto ExtInfo = FTy->getExtInfo();
364364
ExtInfo = ExtInfo.withRepresentation(SILFunctionTypeRepresentation::Thin);
365-
auto witnessMethodConformance = FTy->getWitnessMethodConformanceOrNone();
365+
auto witnessMethodConformance = FTy->getWitnessMethodConformanceOrInvalid();
366366

367367
/// Return the new signature.
368368
return SILFunctionType::get(

lib/SILOptimizer/FunctionSignatureTransforms/FunctionSignatureOpts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ FunctionSignatureTransformDescriptor::createOptimizedSILFunctionType() {
378378

379379
// Don't use a method representation if we modified self.
380380
auto ExtInfo = FTy->getExtInfo();
381-
auto witnessMethodConformance = FTy->getWitnessMethodConformanceOrNone();
381+
auto witnessMethodConformance = FTy->getWitnessMethodConformanceOrInvalid();
382382
if (shouldModifySelfArgument) {
383383
ExtInfo = ExtInfo.withRepresentation(SILFunctionTypeRepresentation::Thin);
384384
witnessMethodConformance = ProtocolConformanceRef::forInvalid();

0 commit comments

Comments
 (0)