mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Import as memory] SILGen for delegation to a C function imported as an initializer.
Always statically dispatch to C functions imported as members, and call to the foreign entry point. This gets us through SILGen, but DI is still deeply unhappy with the resulting SIL.
This commit is contained in:
@@ -35,6 +35,10 @@ swift::getMethodDispatch(AbstractFunctionDecl *method) {
|
||||
if (method->hasForcedStaticDispatch())
|
||||
return MethodDispatch::Static;
|
||||
|
||||
// Import-as-member declarations are always statically referenced.
|
||||
if (method->isImportAsMember())
|
||||
return MethodDispatch::Static;
|
||||
|
||||
// If this declaration is in a class but not marked final, then it is
|
||||
// always dynamically dispatched.
|
||||
auto dc = method->getDeclContext();
|
||||
|
||||
Reference in New Issue
Block a user