mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -490,11 +490,15 @@ public:
|
||||
/// \return null if this module has no such function
|
||||
SILFunction *lookUpFunction(SILDeclRef fnRef);
|
||||
|
||||
/// Attempt to deserialize the SILFunction. Returns true if deserialization
|
||||
/// succeeded, false otherwise.
|
||||
bool loadFunction(SILFunction *F);
|
||||
|
||||
/// Attempt to link the SILFunction. Returns true if linking succeeded, false
|
||||
/// otherwise.
|
||||
///
|
||||
/// \return false if the linking failed.
|
||||
bool linkFunction(SILFunction *Fun,
|
||||
bool linkFunction(SILFunction *F,
|
||||
LinkingMode LinkAll = LinkingMode::LinkNormal);
|
||||
|
||||
/// Check if a given function exists in any of the modules with a
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user