Revert "Make sure we always de-serialize transparent functions."

This reverts commit 821b365054.

It caused a bunch of execution time regressions.
This commit is contained in:
Michael Gottesman
2017-02-18 13:36:34 -08:00
parent bd0207f343
commit 81dcdba0a9
4 changed files with 5 additions and 43 deletions

View File

@@ -179,10 +179,8 @@ SILModule::lookUpWitnessTable(const ProtocolConformance *C,
// *NOTE* In practice, wtable will be deserializedTable, but I do not want to rely
// on that behavior for now.
if (deserializeLazily)
if (auto deserialized = getSILLoader()->lookupWitnessTable(wtable)) {
linkTransparentFunctions();
if (auto deserialized = getSILLoader()->lookupWitnessTable(wtable))
return deserialized;
}
// If we fail, just return the declaration.
return wtable;
@@ -591,25 +589,8 @@ void SILModule::removeFromZombieList(StringRef Name) {
}
}
void SILModule::linkTransparentFunctions() {
FunctionListType::iterator Iter = functions.begin();
if (LastFunctionChecked) {
Iter = LastFunctionChecked->getIterator();
Iter++;
}
while (Iter != functions.end()) {
SILFunction *F = &*Iter;
Iter++;
LastFunctionChecked = F;
if (F->isTransparent() && F->isExternalDeclaration())
linkFunction(F, LinkingMode::LinkNormal);
}
}
/// Erase a function from the module.
void SILModule::eraseFunction(SILFunction *F) {
if (F == LastFunctionChecked)
LastFunctionChecked = nullptr;
assert(! F->isZombie() && "zombie function is in list of alive functions");
if (F->isInlined() || F->isExternallyUsedSymbol()) {