SIL: Add SILModule::loadFunction()

This is like linkFunction(), except it only deserializes the immediate
function body, without recursively walking its transitive dependencies.
This commit is contained in:
Slava Pestov
2018-04-12 17:32:28 -07:00
parent 0039f25483
commit f4b170c144
2 changed files with 16 additions and 3 deletions

View File

@@ -485,8 +485,17 @@ SILFunction *SILModule::lookUpFunction(SILDeclRef fnRef) {
return lookUpFunction(name);
}
bool SILModule::linkFunction(SILFunction *Fun, SILModule::LinkingMode Mode) {
return SILLinkerVisitor(*this, getSILLoader(), Mode).processFunction(Fun);
bool SILModule::loadFunction(SILFunction *F) {
SILFunction *NewF = getSILLoader()->lookupSILFunction(F);
if (!NewF)
return false;
assert(F == NewF);
return true;
}
bool SILModule::linkFunction(SILFunction *F, SILModule::LinkingMode Mode) {
return SILLinkerVisitor(*this, getSILLoader(), Mode).processFunction(F);
}
SILFunction *SILModule::findFunction(StringRef Name, SILLinkage Linkage) {