KT-63264: Introduce a new ExportedBridge annotation

Swift Export Frontend generates a Kotlin file/library that contains a
set of simple bridging functions that connect Swift wrappers to their
Kotlin counterparts.
There are certain requirements for these wrappers:
1. They should not be DCEd when compiling a binary library.
In other words, these functions are roots.
2. They should provide a stable simple binary name.
3. Their signatures should be much simpler and restricted comparing to
other Kotlin functions.

Altogether, these requirements should be covered by introducing the new
ExportedBridge annotation.

Note: Frontend checks of ExportedBridge functions are not implemented
yet.
This commit is contained in:
Sergey Bogolepov
2023-11-25 11:58:08 +02:00
committed by Space Team
parent 8be547b834
commit ce4eecebf4
7 changed files with 30 additions and 5 deletions
@@ -11,6 +11,7 @@ object NativeRuntimeNames {
object Annotations {
val symbolNameClassId = ClassId(kotlinNativePackage, Name.identifier("SymbolName"))
val cNameClassId = ClassId(kotlinNativePackage, Name.identifier("CName"))
val exportedBridgeClassId = ClassId(kotlinNativeInternalPackage, Name.identifier("ExportedBridge"))
val exportForCppRuntimeClassId = ClassId(kotlinNativeInternalPackage, Name.identifier("ExportForCppRuntime"))
val exportForCompilerClassId = ClassId(kotlinNativeInternalPackage, Name.identifier("ExportForCompiler"))
val gcUnsafeCallClassId = ClassId(kotlinNativeInternalPackage, Name.identifier("GCUnsafeCall"))