Skip to content

Commit 7f9a71c

Browse files
committed
AST: Rename ASTContext::getConformance() to getNormalConformance()
1 parent 05ac7e3 commit 7f9a71c

File tree

7 files changed

+29
-24
lines changed

7 files changed

+29
-24
lines changed

include/swift/AST/ASTContext.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,13 +1258,16 @@ class ASTContext final {
12581258
unsigned bumpGeneration() { return CurrentGeneration++; }
12591259

12601260
/// Produce a "normal" conformance for a nominal type.
1261+
///
1262+
/// For ordinary conformance lookups, use ModuleDecl::lookupConformance()
1263+
/// instead.
12611264
NormalProtocolConformance *
1262-
getConformance(Type conformingType,
1263-
ProtocolDecl *protocol,
1264-
SourceLoc loc,
1265-
DeclContext *dc,
1266-
ProtocolConformanceState state,
1267-
bool isUnchecked);
1265+
getNormalConformance(Type conformingType,
1266+
ProtocolDecl *protocol,
1267+
SourceLoc loc,
1268+
DeclContext *dc,
1269+
ProtocolConformanceState state,
1270+
bool isUnchecked);
12681271

12691272
/// Produce a self-conformance for the given protocol.
12701273
SelfProtocolConformance *

lib/AST/ASTContext.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2638,12 +2638,12 @@ void ASTContext::setExternalSourceLocs(const Decl *D,
26382638
}
26392639

26402640
NormalProtocolConformance *
2641-
ASTContext::getConformance(Type conformingType,
2642-
ProtocolDecl *protocol,
2643-
SourceLoc loc,
2644-
DeclContext *dc,
2645-
ProtocolConformanceState state,
2646-
bool isUnchecked) {
2641+
ASTContext::getNormalConformance(Type conformingType,
2642+
ProtocolDecl *protocol,
2643+
SourceLoc loc,
2644+
DeclContext *dc,
2645+
ProtocolConformanceState state,
2646+
bool isUnchecked) {
26472647
assert(dc->isTypeContext());
26482648

26492649
llvm::FoldingSetNodeID id;

lib/AST/ConformanceLookupTable.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -928,9 +928,9 @@ ConformanceLookupTable::getConformance(NominalTypeDecl *nominal,
928928

929929
// Create or find the normal conformance.
930930
auto normalConf =
931-
ctx.getConformance(conformingType, protocol, conformanceLoc,
932-
conformingDC, ProtocolConformanceState::Incomplete,
933-
entry->Source.getUncheckedLoc().isValid());
931+
ctx.getNormalConformance(conformingType, protocol, conformanceLoc,
932+
conformingDC, ProtocolConformanceState::Incomplete,
933+
entry->Source.getUncheckedLoc().isValid());
934934
// Invalid code may cause the getConformance call below to loop, so break
935935
// the infinite recursion by setting this eagerly to shortcircuit with the
936936
// early return at the start of this function.

lib/ClangImporter/ImportDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9241,7 +9241,7 @@ void ClangImporter::Implementation::loadAllConformances(
92419241
for (auto *protocol : getImportedProtocols(decl)) {
92429242
// FIXME: Build a superclass conformance if the superclass
92439243
// conforms.
9244-
auto conformance = SwiftContext.getConformance(
9244+
auto conformance = SwiftContext.getNormalConformance(
92459245
dc->getDeclaredInterfaceType(),
92469246
protocol, SourceLoc(), dc,
92479247
ProtocolConformanceState::Incomplete,

lib/Sema/CodeSynthesisDistributedActor.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -805,10 +805,11 @@ addDistributedActorCodableConformance(
805805
return nullptr;
806806
}
807807

808-
auto conformance = C.getConformance(actor->getDeclaredInterfaceType(), proto,
809-
actor->getLoc(), /*dc=*/actor,
810-
ProtocolConformanceState::Incomplete,
811-
/*isUnchecked=*/false);
808+
auto conformance = C.getNormalConformance(
809+
actor->getDeclaredInterfaceType(), proto,
810+
actor->getLoc(), /*dc=*/actor,
811+
ProtocolConformanceState::Incomplete,
812+
/*isUnchecked=*/false);
812813
conformance->setSourceKindAndImplyingConformance(
813814
ConformanceEntryKind::Synthesized, nullptr);
814815
actor->registerProtocolConformance(conformance, /*synthesized=*/true);

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4914,7 +4914,7 @@ ProtocolConformance *GetImplicitSendableRequest::evaluate(
49144914
conformanceDC = extension;
49154915
}
49164916

4917-
auto conformance = ctx.getConformance(
4917+
auto conformance = ctx.getNormalConformance(
49184918
nominal->getDeclaredInterfaceType(), proto, nominal->getLoc(),
49194919
conformanceDC, ProtocolConformanceState::Complete,
49204920
/*isUnchecked=*/attrMakingUnavailable != nullptr);

lib/Serialization/Deserialization.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -951,9 +951,10 @@ ProtocolConformanceDeserializer::readNormalProtocolConformance(
951951

952952
PrettyStackTraceDecl traceTo("... to", proto);
953953

954-
auto conformance = ctx.getConformance(conformingType, proto, SourceLoc(), dc,
955-
ProtocolConformanceState::Incomplete,
956-
isUnchecked);
954+
auto conformance = ctx.getNormalConformance(
955+
conformingType, proto, SourceLoc(), dc,
956+
ProtocolConformanceState::Incomplete,
957+
isUnchecked);
957958
// Record this conformance.
958959
if (conformanceEntry.isComplete()) {
959960
assert(conformanceEntry.get() == conformance);

0 commit comments

Comments
 (0)