Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

Commit

Permalink
kotlin-objective-c cross resolve: introduce createNamer() function
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmedvedev authored and SvyatoslavScherbina committed Sep 8, 2018
1 parent e6b66bb commit 0d8e176
Showing 1 changed file with 10 additions and 4 deletions.
Expand Up @@ -12,10 +12,7 @@ import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
import org.jetbrains.kotlin.resolve.descriptorUtil.isSubclassOf
import org.jetbrains.kotlin.resolve.descriptorUtil.module
import org.jetbrains.kotlin.resolve.descriptorUtil.parentsWithSelf
import org.jetbrains.kotlin.resolve.descriptorUtil.*

interface ObjCExportNamer {
fun getPackageName(fqName: FqName): String
Expand All @@ -27,6 +24,15 @@ interface ObjCExportNamer {
fun getEnumEntrySelector(descriptor: ClassDescriptor): String
}

fun createNamer(moduleDescriptor: ModuleDescriptor,
topLevelNamePrefix: String = moduleDescriptor.namePrefix): ObjCExportNamer {
val generator = object : ObjCExportHeaderGenerator(moduleDescriptor, moduleDescriptor.builtIns, topLevelNamePrefix) {
override fun reportWarning(text: String) {}
override fun reportWarning(method: FunctionDescriptor, text: String) {}
}
return generator.namer
}

internal class ObjCExportNamerImpl(
val moduleDescriptor: ModuleDescriptor,
builtIns: KotlinBuiltIns,
Expand Down

0 comments on commit 0d8e176

Please sign in to comment.