[Native] Escape the module name in the C adapter.

This previously failed if the module name contaned dots or dashes, e.g.

```
kotlinc-native ~/test.kt -produce static -module-name="foo-bar.baz"
```

This change espaces `-` and `.` similar to `ObjCExportNamer`'s `abbreviate`.
This commit is contained in:
Martin Petrov
2021-12-23 17:06:38 -05:00
committed by SvyatoslavScherbina
parent f895e92b11
commit 50250ccf65
@@ -521,7 +521,7 @@ private fun ModuleDescriptor.getPackageFragments(): List<PackageFragmentDescript
internal class CAdapterGenerator(val context: Context) : DeclarationDescriptorVisitor<Boolean, Void?> {
private val scopes = mutableListOf<ExportedElementScope>()
internal val prefix = context.config.fullExportedNamePrefix
internal val prefix = context.config.fullExportedNamePrefix.replace("-|\\.".toRegex(), "_")
private lateinit var outputStreamWriter: PrintWriter
private val paramNamesRecorded = mutableMapOf<String, Int>()