Skip to content

Commit bc244d1

Browse files
committed
SIL: move the FunctionBuilderTy template argument from TypeSubstCloner to remapParentFunction
1 parent a1d18cf commit bc244d1

File tree

8 files changed

+13
-15
lines changed

8 files changed

+13
-15
lines changed

include/swift/SIL/TypeSubstCloner.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ namespace swift {
3636
/// subclasses. Used to break a circular dependency from SIL <=>
3737
/// SILOptimizer that would be caused by us needing to use
3838
/// SILOptFunctionBuilder here.
39-
template<typename ImplClass, typename FunctionBuilderTy>
39+
template<typename ImplClass>
4040
class TypeSubstCloner : public SILClonerWithScopes<ImplClass> {
4141
friend class SILInstructionVisitor<ImplClass>;
4242
friend class SILCloner<ImplClass>;
@@ -386,6 +386,7 @@ class TypeSubstCloner : public SILClonerWithScopes<ImplClass> {
386386
/// necessary when inlining said function into a new generic context.
387387
/// \param SubsMap - the substitutions of the inlining/specialization process.
388388
/// \param RemappedSig - the generic signature.
389+
template<typename FunctionBuilderTy>
389390
static SILFunction *remapParentFunction(FunctionBuilderTy &FuncBuilder,
390391
SILModule &M,
391392
SILFunction *ParentFunction,

include/swift/SILOptimizer/Differentiation/Common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ inline void createEntryArguments(SILFunction *f) {
286286

287287
/// Cloner that remaps types using the target function's generic environment.
288288
class BasicTypeSubstCloner final
289-
: public TypeSubstCloner<BasicTypeSubstCloner, SILOptFunctionBuilder> {
289+
: public TypeSubstCloner<BasicTypeSubstCloner> {
290290

291291
static SubstitutionMap getSubstitutionMap(SILFunction *target) {
292292
if (auto *targetGenEnv = target->getGenericEnvironment())

include/swift/SILOptimizer/Utils/GenericCloner.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
namespace swift {
3131

3232
class GenericCloner
33-
: public TypeSubstCloner<GenericCloner, SILOptFunctionBuilder> {
34-
using SuperTy = TypeSubstCloner<GenericCloner, SILOptFunctionBuilder>;
33+
: public TypeSubstCloner<GenericCloner> {
34+
using SuperTy = TypeSubstCloner<GenericCloner>;
3535

3636
SILOptFunctionBuilder &FuncBuilder;
3737
SerializedKind_t Serialized;

lib/SILOptimizer/Differentiation/JVPCloner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ namespace swift {
4242
namespace autodiff {
4343

4444
class JVPCloner::Implementation final
45-
: public TypeSubstCloner<JVPCloner::Implementation, SILOptFunctionBuilder> {
45+
: public TypeSubstCloner<JVPCloner::Implementation> {
4646
private:
4747
/// The global context.
4848
ADContext &context;

lib/SILOptimizer/Differentiation/VJPCloner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ namespace swift {
4141
namespace autodiff {
4242

4343
class VJPCloner::Implementation final
44-
: public TypeSubstCloner<VJPCloner::Implementation, SILOptFunctionBuilder> {
44+
: public TypeSubstCloner<VJPCloner::Implementation> {
4545
friend class VJPCloner;
4646
friend class PullbackCloner;
4747

lib/SILOptimizer/FunctionSignatureTransforms/ExistentialTransform.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,8 @@ using llvm::SmallVectorImpl;
4343
/// Create a SILCloner for Existential Specilizer.
4444
namespace {
4545
class ExistentialSpecializerCloner
46-
: public TypeSubstCloner<ExistentialSpecializerCloner,
47-
SILOptFunctionBuilder> {
48-
using SuperTy =
49-
TypeSubstCloner<ExistentialSpecializerCloner, SILOptFunctionBuilder>;
46+
: public TypeSubstCloner<ExistentialSpecializerCloner> {
47+
using SuperTy = TypeSubstCloner<ExistentialSpecializerCloner>;
5048
friend class SILInstructionVisitor<ExistentialSpecializerCloner>;
5149
friend class SILCloner<ExistentialSpecializerCloner>;
5250

lib/SILOptimizer/IPO/CapturePropagation.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,8 @@ namespace {
113113
/// caller, so the cloned function will have a mix of locations from different
114114
/// functions.
115115
class CapturePropagationCloner
116-
: public TypeSubstCloner<CapturePropagationCloner, SILOptFunctionBuilder> {
117-
using SuperTy =
118-
TypeSubstCloner<CapturePropagationCloner, SILOptFunctionBuilder>;
116+
: public TypeSubstCloner<CapturePropagationCloner> {
117+
using SuperTy = TypeSubstCloner<CapturePropagationCloner>;
119118
friend class SILInstructionVisitor<CapturePropagationCloner>;
120119
friend class SILCloner<CapturePropagationCloner>;
121120

lib/SILOptimizer/Utils/SILInliner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,10 @@ class BeginApplySite {
307307

308308
namespace swift {
309309
class SILInlineCloner
310-
: public TypeSubstCloner<SILInlineCloner, SILOptFunctionBuilder> {
310+
: public TypeSubstCloner<SILInlineCloner> {
311311
friend class SILInstructionVisitor<SILInlineCloner>;
312312
friend class SILCloner<SILInlineCloner>;
313-
using SuperTy = TypeSubstCloner<SILInlineCloner, SILOptFunctionBuilder>;
313+
using SuperTy = TypeSubstCloner<SILInlineCloner>;
314314
using InlineKind = SILInliner::InlineKind;
315315

316316
SILOptFunctionBuilder &FuncBuilder;

0 commit comments

Comments
 (0)