Get rid of some build warnings.
This commit is contained in:
committed by
alexander-gorshenev
parent
61dc49b4b7
commit
d752d97dbd
@@ -92,7 +92,7 @@ task renamePackage(type: Copy) {
|
||||
from 'build/generated/source/proto/compiler/java'
|
||||
into 'build/renamed/source/proto/compiler/java'
|
||||
filter {line -> line.replaceAll("com.google.protobuf", "org.jetbrains.kotlin.protobuf")}
|
||||
outputs.files('build/renamed')
|
||||
outputs.dir('build/renamed')
|
||||
}
|
||||
|
||||
kotlinNativeInterop {
|
||||
@@ -197,7 +197,7 @@ targetList.each { target ->
|
||||
inputs.dir(project(':runtime').file('src/main/kotlin'))
|
||||
inputs.dir(project(':Interop:Runtime').file('src/main/kotlin'))
|
||||
inputs.dir(project(':Interop:Runtime').file('src/native/kotlin'))
|
||||
outputs.file(project(':runtime').file("build/${target}Stdlib"))
|
||||
outputs.dir(project(':runtime').file("build/${target}Stdlib"))
|
||||
|
||||
dependsOn ":runtime:${target}Runtime"
|
||||
}
|
||||
@@ -212,7 +212,7 @@ targetList.each { target ->
|
||||
project(':runtime').file('src/launcher/kotlin')]
|
||||
|
||||
inputs.dir(project(':runtime').file('src/launcher/kotlin'))
|
||||
outputs.file(project(':runtime').file("build/${target}Start"))
|
||||
outputs.dir(project(':runtime').file("build/${target}Start"))
|
||||
|
||||
dependsOn ":runtime:${target}Runtime", "${target}Stdlib"
|
||||
}
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import org.jetbrains.kotlin.konan.exec.*
|
||||
import org.jetbrains.kotlin.konan.target.*
|
||||
import org.jetbrains.kotlin.konan.file.*
|
||||
|
||||
fun produceCAdapterBitcode(clang: TargetClang, headerFileName: String, cppFileName: String, bitcodeFileName: String) {
|
||||
fun produceCAdapterBitcode(clang: TargetClang, cppFileName: String, bitcodeFileName: String) {
|
||||
val clangCommand = clang.clangCXX("-std=c++11", cppFileName, "-emit-llvm", "-c", "-o", bitcodeFileName)
|
||||
runTool(clangCommand)
|
||||
}
|
||||
|
||||
+3
-3
@@ -317,10 +317,10 @@ internal class CAdapterGenerator(val context: Context,
|
||||
ExportedElement(ElementKind.PROPERTY, scopes.last(), declaration.descriptor, this)
|
||||
}
|
||||
|
||||
override fun visitFunction(function: IrFunction) {
|
||||
val descriptor = function.descriptor
|
||||
override fun visitFunction(declaration: IrFunction) {
|
||||
val descriptor = declaration.descriptor
|
||||
if (!descriptor.isEffectivelyPublicApi || !descriptor.kind.isReal) return
|
||||
ExportedElement(ElementKind.FUNCTION, scopes.last(), function.descriptor, this)
|
||||
ExportedElement(ElementKind.FUNCTION, scopes.last(), declaration.descriptor, this)
|
||||
}
|
||||
|
||||
override fun visitClass(declaration: IrClass) {
|
||||
|
||||
-2
@@ -38,7 +38,6 @@ internal fun produceOutput(context: Context) {
|
||||
CompilerOutputKind.DYNAMIC,
|
||||
CompilerOutputKind.FRAMEWORK,
|
||||
CompilerOutputKind.PROGRAM -> {
|
||||
val program = context.config.outputName
|
||||
val output = tempFiles.nativeBinaryFileName
|
||||
context.bitcodeFileName = output
|
||||
|
||||
@@ -46,7 +45,6 @@ internal fun produceOutput(context: Context) {
|
||||
if (produce == CompilerOutputKind.DYNAMIC) {
|
||||
produceCAdapterBitcode(
|
||||
context.config.clang,
|
||||
tempFiles.cAdapterHeaderName,
|
||||
tempFiles.cAdapterCppName,
|
||||
tempFiles.cAdapterBitcodeName)
|
||||
listOf(tempFiles.cAdapterBitcodeName)
|
||||
|
||||
-4
@@ -22,8 +22,6 @@ import java.lang.ProcessBuilder.Redirect
|
||||
import org.jetbrains.kotlin.konan.file.*
|
||||
import org.jetbrains.kotlin.konan.properties.*
|
||||
import org.jetbrains.kotlin.konan.target.*
|
||||
import org.jetbrains.kotlin.backend.konan.util.listConstructor
|
||||
import org.jetbrains.kotlin.backend.konan.util.If
|
||||
|
||||
typealias BitcodeFile = String
|
||||
typealias ObjectFile = String
|
||||
@@ -269,8 +267,6 @@ internal open class WasmPlatform(distribution: Distribution)
|
||||
private fun javaScriptLink(jsFiles: List<String>, executable: String): String {
|
||||
val linkedJavaScript = File("$executable.js")
|
||||
|
||||
val jsLibsExceptLauncher = jsFiles.filter { it != "launcher.js" }.map { it.removeSuffix(".js") }
|
||||
|
||||
val linkerStub = "var konan = { libraries: [] };\n"
|
||||
|
||||
linkedJavaScript.writeBytes(linkerStub.toByteArray());
|
||||
|
||||
+3
-3
@@ -1009,7 +1009,7 @@ internal class IrDeserializer(val context: Context,
|
||||
return IrWhenImpl(start, end, type, null, branches)
|
||||
}
|
||||
|
||||
fun deserializeLoop(proto: KonanIr.Loop, start: Int, end: Int, type: KotlinType, loop: IrLoopBase): IrLoopBase {
|
||||
fun deserializeLoop(proto: KonanIr.Loop, loop: IrLoopBase): IrLoopBase {
|
||||
val loopId = proto.getLoopId()
|
||||
loopIndex.getOrPut(loopId){loop}
|
||||
|
||||
@@ -1028,7 +1028,7 @@ internal class IrDeserializer(val context: Context,
|
||||
// we create the loop before deserializing the body, so that
|
||||
// IrBreak statements have something to put into 'loop' field.
|
||||
val loop = IrDoWhileLoopImpl(start, end, type, null)
|
||||
deserializeLoop(proto.loop, start, end, type, loop)
|
||||
deserializeLoop(proto.loop, loop)
|
||||
return loop
|
||||
}
|
||||
|
||||
@@ -1036,7 +1036,7 @@ internal class IrDeserializer(val context: Context,
|
||||
// we create the loop before deserializing the body, so that
|
||||
// IrBreak statements have something to put into 'loop' field.
|
||||
val loop = IrWhileLoopImpl(start, end, type, null)
|
||||
deserializeLoop(proto.loop, start, end, type, loop)
|
||||
deserializeLoop(proto.loop, loop)
|
||||
return loop
|
||||
}
|
||||
|
||||
|
||||
-32
@@ -54,35 +54,3 @@ fun String.removeSuffixIfPresent(suffix: String) =
|
||||
if (this.endsWith(suffix)) this.dropLast(suffix.length) else this
|
||||
|
||||
fun <T> Lazy<T>.getValueOrNull(): T? = if (isInitialized()) value else null
|
||||
|
||||
// The listConstructor() and If functions are convenient to construct
|
||||
// command lines having a bunch of elements, lists and conditions.
|
||||
// Use them like
|
||||
//
|
||||
// listConstructor(
|
||||
// anElement1,
|
||||
// If (condition1,
|
||||
// element2),
|
||||
// aList1,
|
||||
// If (condition2,
|
||||
// alist3,
|
||||
// alist4)
|
||||
// )
|
||||
|
||||
internal fun listConstructor(vararg elements: Any): List<String> {
|
||||
val result = mutableListOf<String>()
|
||||
for (element in elements) {
|
||||
when (element) {
|
||||
null -> {}
|
||||
is String -> result.add(element)
|
||||
is List<*> -> result.addAll(element as List<String>)
|
||||
else -> error("Unexpected element of listConstructor: $element")
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
internal fun If (condition: Boolean, vararg elements: Any): List<String> =
|
||||
if (condition) listConstructor(*elements) else emptyList()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user