Skip to content

Commit 76dab79

Browse files
authored
Merge pull request #60405 from simanerush/sil-remove-parameter
SIL: Remove unused parameter
2 parents e54519e + 7b00eb6 commit 76dab79

File tree

2 files changed

+45
-58
lines changed

2 files changed

+45
-58
lines changed

include/swift/SIL/SILFunction.h

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,11 @@ class SILFunction
404404

405405
SILFunction(SILModule &module, SILLinkage linkage, StringRef mangledName,
406406
CanSILFunctionType loweredType, GenericEnvironment *genericEnv,
407-
Optional<SILLocation> loc, IsBare_t isBareSILFunction,
408-
IsTransparent_t isTrans, IsSerialized_t isSerialized,
409-
ProfileCounter entryCount, IsThunk_t isThunk,
410-
SubclassScope classSubclassScope, Inline_t inlineStrategy,
411-
EffectsKind E, const SILDebugScope *debugScope,
407+
IsBare_t isBareSILFunction, IsTransparent_t isTrans,
408+
IsSerialized_t isSerialized, ProfileCounter entryCount,
409+
IsThunk_t isThunk, SubclassScope classSubclassScope,
410+
Inline_t inlineStrategy, EffectsKind E,
411+
const SILDebugScope *debugScope,
412412
IsDynamicallyReplaceable_t isDynamic,
413413
IsExactSelfClass_t isExactSelfClass,
414414
IsDistributed_t isDistributed);
@@ -428,18 +428,14 @@ class SILFunction
428428
SILFunction *InsertBefore = nullptr,
429429
const SILDebugScope *DebugScope = nullptr);
430430

431-
void init(SILLinkage Linkage, StringRef Name,
432-
CanSILFunctionType LoweredType,
433-
GenericEnvironment *genericEnv,
434-
Optional<SILLocation> Loc, IsBare_t isBareSILFunction,
435-
IsTransparent_t isTrans, IsSerialized_t isSerialized,
436-
ProfileCounter entryCount, IsThunk_t isThunk,
437-
SubclassScope classSubclassScope,
438-
Inline_t inlineStrategy, EffectsKind E,
439-
const SILDebugScope *DebugScope,
440-
IsDynamicallyReplaceable_t isDynamic,
441-
IsExactSelfClass_t isExactSelfClass,
442-
IsDistributed_t isDistributed);
431+
void init(SILLinkage Linkage, StringRef Name, CanSILFunctionType LoweredType,
432+
GenericEnvironment *genericEnv, IsBare_t isBareSILFunction,
433+
IsTransparent_t isTrans, IsSerialized_t isSerialized,
434+
ProfileCounter entryCount, IsThunk_t isThunk,
435+
SubclassScope classSubclassScope, Inline_t inlineStrategy,
436+
EffectsKind E, const SILDebugScope *DebugScope,
437+
IsDynamicallyReplaceable_t isDynamic,
438+
IsExactSelfClass_t isExactSelfClass, IsDistributed_t isDistributed);
443439

444440
/// Set has ownership to the given value. True means that the function has
445441
/// ownership, false means it does not.

lib/SIL/IR/SILFunction.cpp

Lines changed: 32 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,16 @@ SILFunction::create(SILModule &M, SILLinkage linkage, StringRef name,
108108
// Resurrect a zombie function.
109109
// This happens for example if a specialized function gets dead and gets
110110
// deleted. And afterwards the same specialization is created again.
111-
fn->init(linkage, name, loweredType, genericEnv, loc, isBareSILFunction,
112-
isTrans, isSerialized, entryCount, isThunk, classSubclassScope,
111+
fn->init(linkage, name, loweredType, genericEnv, isBareSILFunction, isTrans,
112+
isSerialized, entryCount, isThunk, classSubclassScope,
113113
inlineStrategy, E, debugScope, isDynamic, isExactSelfClass,
114114
isDistributed);
115115
assert(fn->empty());
116116
} else {
117-
fn = new (M) SILFunction(M, linkage, name, loweredType, genericEnv, loc,
118-
isBareSILFunction, isTrans, isSerialized,
119-
entryCount, isThunk, classSubclassScope,
120-
inlineStrategy, E, debugScope,
121-
isDynamic, isExactSelfClass, isDistributed);
117+
fn = new (M) SILFunction(
118+
M, linkage, name, loweredType, genericEnv, isBareSILFunction, isTrans,
119+
isSerialized, entryCount, isThunk, classSubclassScope, inlineStrategy,
120+
E, debugScope, isDynamic, isExactSelfClass, isDistributed);
122121
}
123122
if (entry) entry->setValue(fn);
124123

@@ -138,44 +137,36 @@ static FunctionParseFn parseFunction = nullptr;
138137
static FunctionCopyEffectsFn copyEffectsFunction = nullptr;
139138
static FunctionGetEffectFlagsFn getEffectFlagsFunction = nullptr;
140139

141-
SILFunction::SILFunction(SILModule &Module, SILLinkage Linkage, StringRef Name,
142-
CanSILFunctionType LoweredType,
143-
GenericEnvironment *genericEnv,
144-
Optional<SILLocation> Loc, IsBare_t isBareSILFunction,
145-
IsTransparent_t isTrans, IsSerialized_t isSerialized,
146-
ProfileCounter entryCount, IsThunk_t isThunk,
147-
SubclassScope classSubclassScope,
148-
Inline_t inlineStrategy, EffectsKind E,
149-
const SILDebugScope *DebugScope,
150-
IsDynamicallyReplaceable_t isDynamic,
151-
IsExactSelfClass_t isExactSelfClass,
152-
IsDistributed_t isDistributed)
140+
SILFunction::SILFunction(
141+
SILModule &Module, SILLinkage Linkage, StringRef Name,
142+
CanSILFunctionType LoweredType, GenericEnvironment *genericEnv,
143+
IsBare_t isBareSILFunction, IsTransparent_t isTrans,
144+
IsSerialized_t isSerialized, ProfileCounter entryCount, IsThunk_t isThunk,
145+
SubclassScope classSubclassScope, Inline_t inlineStrategy, EffectsKind E,
146+
const SILDebugScope *DebugScope, IsDynamicallyReplaceable_t isDynamic,
147+
IsExactSelfClass_t isExactSelfClass, IsDistributed_t isDistributed)
153148
: SwiftObjectHeader(functionMetatype), Module(Module),
154149
index(Module.getNewFunctionIndex()),
155150
Availability(AvailabilityContext::alwaysAvailable()) {
156-
init(Linkage, Name, LoweredType, genericEnv, Loc, isBareSILFunction, isTrans,
157-
isSerialized, entryCount, isThunk, classSubclassScope, inlineStrategy,
158-
E, DebugScope, isDynamic, isExactSelfClass, isDistributed);
159-
151+
init(Linkage, Name, LoweredType, genericEnv, isBareSILFunction, isTrans,
152+
isSerialized, entryCount, isThunk, classSubclassScope, inlineStrategy, E,
153+
DebugScope, isDynamic, isExactSelfClass, isDistributed);
154+
160155
// Set our BB list to have this function as its parent. This enables us to
161156
// splice efficiently basic blocks in between functions.
162157
BlockList.Parent = this;
163158
if (initFunction)
164159
initFunction({this}, &libswiftSpecificData, sizeof(libswiftSpecificData));
165160
}
166161

167-
void SILFunction::init(SILLinkage Linkage, StringRef Name,
168-
CanSILFunctionType LoweredType,
169-
GenericEnvironment *genericEnv,
170-
Optional<SILLocation> Loc, IsBare_t isBareSILFunction,
171-
IsTransparent_t isTrans, IsSerialized_t isSerialized,
172-
ProfileCounter entryCount, IsThunk_t isThunk,
173-
SubclassScope classSubclassScope,
174-
Inline_t inlineStrategy, EffectsKind E,
175-
const SILDebugScope *DebugScope,
176-
IsDynamicallyReplaceable_t isDynamic,
177-
IsExactSelfClass_t isExactSelfClass,
178-
IsDistributed_t isDistributed) {
162+
void SILFunction::init(
163+
SILLinkage Linkage, StringRef Name, CanSILFunctionType LoweredType,
164+
GenericEnvironment *genericEnv, IsBare_t isBareSILFunction,
165+
IsTransparent_t isTrans, IsSerialized_t isSerialized,
166+
ProfileCounter entryCount, IsThunk_t isThunk,
167+
SubclassScope classSubclassScope, Inline_t inlineStrategy, EffectsKind E,
168+
const SILDebugScope *DebugScope, IsDynamicallyReplaceable_t isDynamic,
169+
IsExactSelfClass_t isExactSelfClass, IsDistributed_t isDistributed) {
179170
setName(Name);
180171
this->LoweredType = LoweredType;
181172
this->GenericEnv = genericEnv;
@@ -244,12 +235,12 @@ void SILFunction::createSnapshot(int id) {
244235
assert(id != 0 && "invalid snapshot ID");
245236
assert(!getSnapshot(id) && "duplicate snapshot");
246237

247-
SILFunction *newSnapshot = new (Module) SILFunction(Module,
248-
getLinkage(), getName(), getLoweredFunctionType(), getGenericEnvironment(),
249-
getLocation(), isBare(), isTransparent(), isSerialized(),
250-
getEntryCount(), isThunk(), getClassSubclassScope(),
251-
getInlineStrategy(), getEffectsKind(), getDebugScope(),
252-
isDynamicallyReplaceable(), isExactSelfClass(), isDistributed());
238+
SILFunction *newSnapshot = new (Module) SILFunction(
239+
Module, getLinkage(), getName(), getLoweredFunctionType(),
240+
getGenericEnvironment(), isBare(), isTransparent(), isSerialized(),
241+
getEntryCount(), isThunk(), getClassSubclassScope(), getInlineStrategy(),
242+
getEffectsKind(), getDebugScope(), isDynamicallyReplaceable(),
243+
isExactSelfClass(), isDistributed());
253244

254245
// Copy all relevant properties.
255246
// TODO: It's really unfortunate that this needs to be done manually. It would

0 commit comments

Comments
 (0)