Merge pull request #1469 from swiftix/wip-has-sil-funciton

Implement a more light-weight approach to perform lookups of existing pre-specializations
This commit is contained in:
swiftix
2016-02-27 08:11:09 -08:00
10 changed files with 131 additions and 41 deletions

View File

@@ -469,6 +469,15 @@ bool SILModule::linkFunction(StringRef Name, SILModule::LinkingMode Mode) {
return SILLinkerVisitor(*this, getSILLoader(), Mode).processFunction(Name);
}
SILFunction *SILModule::hasFunction(StringRef Name, SILLinkage Linkage) {
assert(!lookUpFunction(Name) && "hasFunction should be only called for "
"functions that are not contained in the "
"SILModule yet");
return SILLinkerVisitor(*this, getSILLoader(),
SILModule::LinkingMode::LinkNormal)
.lookupFunction(Name, Linkage);
}
void SILModule::linkAllWitnessTables() {
getSILLoader()->getAllWitnessTables();
}
@@ -517,6 +526,10 @@ void SILModule::eraseFunction(SILFunction *F) {
}
}
void SILModule::invalidateFunctionInSILCache(SILFunction *F) {
getSILLoader()->invalidateFunction(F);
}
/// Erase a global SIL variable from the module.
void SILModule::eraseGlobalVariable(SILGlobalVariable *G) {
GlobalVariableMap.erase(G->getName());