mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user