[K/N] Opt-in for meaningful names for in "objc2kotlin" bridges

It is hard to run FileCheck tests over generated ObjC bridges because
they share the same name ("objc2kotlin"). To overcome this hurdle,
this commit introduces a compiler flag that appends function name to
"objc2_kotlin". This change might be useful for end-users, for example,
it makes stacktraces more readable. But it will require additional
testing and polishing which is out of the scope of this change.
This commit is contained in:
Sergey Bogolepov
2021-10-06 17:47:14 +07:00
committed by Space
parent cf3296c94c
commit e37d669dc3
4 changed files with 20 additions and 2 deletions
@@ -391,6 +391,7 @@ class K2Native : CLICompiler<K2NativeCompilerArguments>() {
})
putIfNotNull(RUNTIME_LOGS, arguments.runtimeLogs)
putIfNotNull(BUNDLE_ID, parseBundleId(arguments, outputKind, configuration))
put(MEANINGFUL_BRIDGE_NAMES, arguments.meaningfulBridgeNames)
}
}
}
@@ -361,6 +361,9 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
@Argument(value = "-Xruntime-logs", valueDescription = "<tag1=level1,tag2=level2,...>", description = "Enable logging for runtime with tags.")
var runtimeLogs: String? = null
@Argument(value = "-Xmeaningful-bridge-names", description = "(Unstable) Produce meaningful names for reverse bridges. Useful only for compiler tests.")
var meaningfulBridgeNames: Boolean = false
@Argument(value = "-Xlazy-ir-for-caches", valueDescription = "{disable|enable}", description = "Use lazy IR for cached libraries")
var lazyIrForCaches: String? = null