[K/N][IR][codegen] Preliminary support of per-file caches
This commit is contained in:
+8
-9
@@ -205,14 +205,6 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
|
||||
var generateDebugTrampolineString: String? = null
|
||||
|
||||
|
||||
@Argument(
|
||||
value = MAKE_CACHE,
|
||||
valueDescription = "<path>",
|
||||
description = "Path of the library to be compiled to cache",
|
||||
delimiter = ""
|
||||
)
|
||||
var librariesToCache: Array<String>? = null
|
||||
|
||||
@Argument(
|
||||
value = ADD_CACHE,
|
||||
valueDescription = "<path>",
|
||||
@@ -221,6 +213,14 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
|
||||
)
|
||||
var libraryToAddToCache: String? = null
|
||||
|
||||
@Argument(
|
||||
value = "-Xfile-to-cache",
|
||||
valueDescription = "<path>",
|
||||
description = "Path to file to cache",
|
||||
delimiter = ""
|
||||
)
|
||||
var fileToCache: String? = null
|
||||
|
||||
@Argument(value = "-Xexport-kdoc", description = "Export KDoc in framework header")
|
||||
var exportKDoc: Boolean = false
|
||||
|
||||
@@ -415,7 +415,6 @@ class K2NativeCompilerArguments : CommonCompilerArguments() {
|
||||
const val STATIC_FRAMEWORK_FLAG = "-Xstatic-framework"
|
||||
const val INCLUDE_ARG = "-Xinclude"
|
||||
const val CACHED_LIBRARY = "-Xcached-library"
|
||||
const val MAKE_CACHE = "-Xmake-cache"
|
||||
const val ADD_CACHE = "-Xadd-cache"
|
||||
const val SHORT_MODULE_NAME_ARG = "-Xshort-module-name"
|
||||
}
|
||||
|
||||
+7
-5
@@ -87,9 +87,8 @@ class FakeOverrideBuilder(
|
||||
fakeOverrideCandidates[clazz] = compatibilityMode
|
||||
}
|
||||
|
||||
private fun buildFakeOverrideChainsForClass(clazz: IrClass, compatibilityMode: CompatibilityMode) {
|
||||
if (haveFakeOverrides.contains(clazz)) return
|
||||
if (!platformSpecificClassFilter.needToConstructFakeOverrides(clazz)) return
|
||||
private fun buildFakeOverrideChainsForClass(clazz: IrClass, compatibilityMode: CompatibilityMode): Boolean {
|
||||
if (haveFakeOverrides.contains(clazz)) return true
|
||||
|
||||
val superTypes = clazz.superTypes
|
||||
|
||||
@@ -99,15 +98,18 @@ class FakeOverrideBuilder(
|
||||
|
||||
superClasses.forEach { superClass ->
|
||||
val mode = fakeOverrideCandidates[superClass] ?: compatibilityMode
|
||||
buildFakeOverrideChainsForClass(superClass, mode)
|
||||
haveFakeOverrides.add(superClass)
|
||||
if (buildFakeOverrideChainsForClass(superClass, mode))
|
||||
haveFakeOverrides.add(superClass)
|
||||
}
|
||||
|
||||
if (!platformSpecificClassFilter.needToConstructFakeOverrides(clazz)) return false
|
||||
|
||||
fakeOverrideDeclarationTable.run {
|
||||
inFile(clazz.fileOrNull) {
|
||||
irOverridingUtil.buildFakeOverridesForClass(clazz, compatibilityMode.oldSignatures)
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun linkFunctionFakeOverride(declaration: IrFakeOverrideFunction, compatibilityMode: Boolean) {
|
||||
|
||||
+1
-1
@@ -183,7 +183,7 @@ class IrKlibBytesSource(private val klib: IrLibrary, private val fileIndex: Int)
|
||||
override fun debugInfo(index: Int): ByteArray? = klib.debugInfo(index, fileIndex)
|
||||
}
|
||||
|
||||
internal fun IrLibraryFile.deserializeFqName(fqn: List<Int>): String =
|
||||
fun IrLibraryFile.deserializeFqName(fqn: List<Int>): String =
|
||||
fqn.joinToString(".", transform = ::string)
|
||||
|
||||
fun IrLibraryFile.createFile(module: IrModuleFragment, fileProto: ProtoFile): IrFile {
|
||||
|
||||
Reference in New Issue
Block a user