mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Extend SILModule with an API for linking of SILFunctions by their SILDeclRef.
Before, providing a full SILFunction declaration object with a proper SILType was the only way to link a function. And constructing such a SILFunction declaration by hand using low-level SIL APIs is very annoying and requires a lot of code to be written. This new linkFunction API allows for a lookup using SILDeclRef and essentially performs linking of a SILFunction by its mangled name (assuming this name is unique), which is much easier to invoke. The new API is useful, e.g. when you need to link a well-known function from a standard library. Swift SVN r26252
This commit is contained in:
@@ -370,6 +370,13 @@ public:
|
||||
bool linkFunction(SILFunction *Fun,
|
||||
LinkingMode LinkAll=LinkingMode::LinkNormal);
|
||||
|
||||
/// Attempt to link a function by declaration. Returns true if linking
|
||||
/// succeeded, false otherwise.
|
||||
///
|
||||
/// \return false if the linking failed.
|
||||
bool linkFunction(SILDeclRef Decl,
|
||||
LinkingMode LinkAll=LinkingMode::LinkNormal);
|
||||
|
||||
/// Link in all Witness Tables in the module.
|
||||
void linkAllWitnessTables();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user