Skip to content

Commit 8e9ce01

Browse files
committed
Remove even more dead code after -sil-serialize-all is gone
1 parent dd85e69 commit 8e9ce01

File tree

5 files changed

+8
-35
lines changed

5 files changed

+8
-35
lines changed

include/swift/SIL/SILModule.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,6 @@ class SILModule {
322322
return wholeModule;
323323
}
324324

325-
/// Returns true if everything in this SILModule is being serialized.
326-
bool isWholeModuleSerialized() const { return false; }
327-
328325
/// Returns true if it is the OnoneSupport module.
329326
bool isOnoneSupportModule() const;
330327

lib/SILGen/SILGen.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,6 @@ SILFunction *SILGenModule::getEmittedFunction(SILDeclRef constant,
461461
if (isAvailableExternally(F->getLinkage())) {
462462
F->setLinkage(constant.getLinkage(ForDefinition));
463463
}
464-
if (isMakeModuleFragile()) {
465-
F->setSerialized(IsSerialized);
466-
}
467464
}
468465
return F;
469466
}
@@ -523,13 +520,6 @@ SILFunction *SILGenModule::getFunction(SILDeclRef constant,
523520

524521
assert(F && "SILFunction should have been defined");
525522

526-
if (isMakeModuleFragile()) {
527-
SILLinkage linkage = constant.getLinkage(forDefinition);
528-
if (linkage != SILLinkage::PublicExternal) {
529-
F->setSerialized(IsSerialized);
530-
}
531-
}
532-
533523
emittedFunctions[constant] = F;
534524

535525
// If we delayed emitting this function previously, we need it now.
@@ -994,9 +984,7 @@ SILFunction *SILGenModule::emitLazyGlobalInitializer(StringRef funcName,
994984
M.createFunction(SILLinkage::Private,
995985
funcName, initSILType, nullptr,
996986
SILLocation(binding), IsNotBare, IsNotTransparent,
997-
isMakeModuleFragile()
998-
? IsSerialized
999-
: IsNotSerialized);
987+
IsNotSerialized);
1000988
f->setDebugScope(new (M) SILDebugScope(RegularLocation(binding), f));
1001989
SILGenFunction(*this, *f).emitLazyGlobalInitializer(binding, pbdEntry);
1002990
f->verify();

lib/SILGen/SILGen.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,9 @@ class LLVM_LIBRARY_VISIBILITY SILGenModule : public ASTVisitor<SILGenModule> {
121121
NormalProtocolConformance *lastEmittedConformance = nullptr;
122122

123123
SILFunction *emitTopLevelFunction(SILLocation Loc);
124-
124+
125125
size_t anonymousSymbolCounter = 0;
126-
127-
/// If true, all functions and globals are made fragile. Currently only used
128-
/// for compiling the stdlib.
129-
bool isMakeModuleFragile() const { return false; }
130-
126+
131127
Optional<SILDeclRef> StringToNSStringFn;
132128
Optional<SILDeclRef> NSStringToStringFn;
133129
Optional<SILDeclRef> ArrayToNSArrayFn;

lib/SILGen/SILGenGlobalVariable.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ SILGlobalVariable *SILGenModule::getSILGlobalVariable(VarDecl *gDecl,
4646
SILLinkage link = getSILLinkage(getDeclLinkage(gDecl), forDef);
4747
SILType silTy = M.Types.getLoweredTypeOfGlobal(gDecl);
4848

49-
auto *silGlobal = SILGlobalVariable::create(M, link,
50-
isMakeModuleFragile()
51-
? IsSerialized
52-
: IsNotSerialized,
49+
auto *silGlobal = SILGlobalVariable::create(M, link, IsNotSerialized,
5350
mangledName, silTy,
5451
None, gDecl);
5552
silGlobal->setDeclaration(!forDef);
@@ -223,9 +220,7 @@ void SILGenModule::emitGlobalInitialization(PatternBindingDecl *pd,
223220
// TODO: include the module in the onceToken's name mangling.
224221
// Then we can make it fragile.
225222
auto onceToken = SILGlobalVariable::create(M, SILLinkage::Private,
226-
isMakeModuleFragile()
227-
? IsSerialized
228-
: IsNotSerialized,
223+
IsNotSerialized,
229224
onceTokenBuffer, onceSILTy);
230225
onceToken->setDeclaration(false);
231226

lib/SILGen/SILGenType.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,8 @@ class SILGenConformance : public SILGenWitnessTable<SILGenConformance> {
375375
Serialized = IsNotSerialized;
376376

377377
// Serialize the witness table if we're serializing everything with
378-
// -sil-serialize-all....
379-
if (SGM.isMakeModuleFragile() ||
380-
SGM.M.getOptions().SILSerializeWitnessTables)
378+
// -sil-serialize-witness-tables....
379+
if (SGM.M.getOptions().SILSerializeWitnessTables)
381380
Serialized = IsSerialized;
382381

383382
// ... or if the conformance itself thinks it should be.
@@ -483,9 +482,7 @@ class SILGenConformance : public SILGenWitnessTable<SILGenConformance> {
483482
if (witnessSerialized &&
484483
fixmeWitnessHasLinkageThatNeedsToBePublic(witnessLinkage)) {
485484
witnessLinkage = SILLinkage::Public;
486-
witnessSerialized = (SGM.isMakeModuleFragile()
487-
? IsSerialized
488-
: IsNotSerialized);
485+
witnessSerialized = IsNotSerialized;
489486
} else {
490487
// This is the "real" rule; the above case should go away once we
491488
// figure out what's going on.

0 commit comments

Comments
 (0)