Skip to content

Commit 6c1afdc

Browse files
committed
Constify ReplaceOpaqueTypesWithUnderlyingTypes's DeclContext
No functionality change.
1 parent a7f6e3d commit 6c1afdc

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

include/swift/AST/Types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4898,9 +4898,9 @@ enum class OpaqueSubstitutionKind {
48984898
/// to their underlying types.
48994899
class ReplaceOpaqueTypesWithUnderlyingTypes {
49004900
public:
4901-
DeclContext *inContext;
4901+
const DeclContext *inContext;
49024902
ResilienceExpansion contextExpansion;
4903-
ReplaceOpaqueTypesWithUnderlyingTypes(DeclContext *inContext,
4903+
ReplaceOpaqueTypesWithUnderlyingTypes(const DeclContext *inContext,
49044904
ResilienceExpansion contextExpansion)
49054905
: inContext(inContext), contextExpansion(contextExpansion) {}
49064906

lib/AST/Type.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2647,7 +2647,7 @@ ReplaceOpaqueTypesWithUnderlyingTypes::shouldPerformSubstitution(
26472647
}
26482648

26492649
static Type
2650-
substOpaqueTypesWithUnderlyingTypes(Type ty, DeclContext *inContext,
2650+
substOpaqueTypesWithUnderlyingTypes(Type ty, const DeclContext *inContext,
26512651
ResilienceExpansion contextExpansion) {
26522652
ReplaceOpaqueTypesWithUnderlyingTypes replacer(inContext, contextExpansion);
26532653
return ty.subst(replacer, replacer, SubstFlags::SubstituteOpaqueArchetypes);
@@ -2659,7 +2659,7 @@ substOpaqueTypesWithUnderlyingTypes(Type ty, DeclContext *inContext,
26592659
/// This is purely an implementation detail check about whether type metadata
26602660
/// will be accessible. It's not intended to enforce any rules about what
26612661
/// opaque substitutions are or are not allowed.
2662-
static bool canSubstituteTypeInto(Type ty, DeclContext *dc,
2662+
static bool canSubstituteTypeInto(Type ty, const DeclContext *dc,
26632663
OpaqueSubstitutionKind kind) {
26642664
auto nominal = ty->getAnyNominal();
26652665
if (!nominal)
@@ -2735,7 +2735,7 @@ operator()(SubstitutableType *maybeOpaqueType) const {
27352735

27362736
static ProtocolConformanceRef
27372737
substOpaqueTypesWithUnderlyingTypes(ProtocolConformanceRef ref, Type origType,
2738-
DeclContext *inContext,
2738+
const DeclContext *inContext,
27392739
ResilienceExpansion contextExpansion) {
27402740
ReplaceOpaqueTypesWithUnderlyingTypes replacer(inContext, contextExpansion);
27412741
return ref.subst(origType, replacer, replacer,

lib/SILOptimizer/Transforms/SpecializeOpaqueArchetypes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ llvm::cl::opt<bool>
3131

3232
using namespace swift;
3333

34-
static DeclContext *
34+
static const DeclContext *
3535
getDeclContextIfInCurrentModule(const SILFunction &fn) {
3636
auto *dc = fn.getDeclContext();
3737
auto *currentModule = fn.getModule().getSwiftModule();

0 commit comments

Comments
 (0)