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'
|
from 'build/generated/source/proto/compiler/java'
|
||||||
into 'build/renamed/source/proto/compiler/java'
|
into 'build/renamed/source/proto/compiler/java'
|
||||||
filter {line -> line.replaceAll("com.google.protobuf", "org.jetbrains.kotlin.protobuf")}
|
filter {line -> line.replaceAll("com.google.protobuf", "org.jetbrains.kotlin.protobuf")}
|
||||||
outputs.files('build/renamed')
|
outputs.dir('build/renamed')
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlinNativeInterop {
|
kotlinNativeInterop {
|
||||||
@@ -197,7 +197,7 @@ targetList.each { target ->
|
|||||||
inputs.dir(project(':runtime').file('src/main/kotlin'))
|
inputs.dir(project(':runtime').file('src/main/kotlin'))
|
||||||
inputs.dir(project(':Interop:Runtime').file('src/main/kotlin'))
|
inputs.dir(project(':Interop:Runtime').file('src/main/kotlin'))
|
||||||
inputs.dir(project(':Interop:Runtime').file('src/native/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"
|
dependsOn ":runtime:${target}Runtime"
|
||||||
}
|
}
|
||||||
@@ -212,7 +212,7 @@ targetList.each { target ->
|
|||||||
project(':runtime').file('src/launcher/kotlin')]
|
project(':runtime').file('src/launcher/kotlin')]
|
||||||
|
|
||||||
inputs.dir(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"
|
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.target.*
|
||||||
import org.jetbrains.kotlin.konan.file.*
|
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)
|
val clangCommand = clang.clangCXX("-std=c++11", cppFileName, "-emit-llvm", "-c", "-o", bitcodeFileName)
|
||||||
runTool(clangCommand)
|
runTool(clangCommand)
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -317,10 +317,10 @@ internal class CAdapterGenerator(val context: Context,
|
|||||||
ExportedElement(ElementKind.PROPERTY, scopes.last(), declaration.descriptor, this)
|
ExportedElement(ElementKind.PROPERTY, scopes.last(), declaration.descriptor, this)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun visitFunction(function: IrFunction) {
|
override fun visitFunction(declaration: IrFunction) {
|
||||||
val descriptor = function.descriptor
|
val descriptor = declaration.descriptor
|
||||||
if (!descriptor.isEffectivelyPublicApi || !descriptor.kind.isReal) return
|
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) {
|
override fun visitClass(declaration: IrClass) {
|
||||||
|
|||||||
-2
@@ -38,7 +38,6 @@ internal fun produceOutput(context: Context) {
|
|||||||
CompilerOutputKind.DYNAMIC,
|
CompilerOutputKind.DYNAMIC,
|
||||||
CompilerOutputKind.FRAMEWORK,
|
CompilerOutputKind.FRAMEWORK,
|
||||||
CompilerOutputKind.PROGRAM -> {
|
CompilerOutputKind.PROGRAM -> {
|
||||||
val program = context.config.outputName
|
|
||||||
val output = tempFiles.nativeBinaryFileName
|
val output = tempFiles.nativeBinaryFileName
|
||||||
context.bitcodeFileName = output
|
context.bitcodeFileName = output
|
||||||
|
|
||||||
@@ -46,7 +45,6 @@ internal fun produceOutput(context: Context) {
|
|||||||
if (produce == CompilerOutputKind.DYNAMIC) {
|
if (produce == CompilerOutputKind.DYNAMIC) {
|
||||||
produceCAdapterBitcode(
|
produceCAdapterBitcode(
|
||||||
context.config.clang,
|
context.config.clang,
|
||||||
tempFiles.cAdapterHeaderName,
|
|
||||||
tempFiles.cAdapterCppName,
|
tempFiles.cAdapterCppName,
|
||||||
tempFiles.cAdapterBitcodeName)
|
tempFiles.cAdapterBitcodeName)
|
||||||
listOf(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.file.*
|
||||||
import org.jetbrains.kotlin.konan.properties.*
|
import org.jetbrains.kotlin.konan.properties.*
|
||||||
import org.jetbrains.kotlin.konan.target.*
|
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 BitcodeFile = String
|
||||||
typealias ObjectFile = String
|
typealias ObjectFile = String
|
||||||
@@ -269,8 +267,6 @@ internal open class WasmPlatform(distribution: Distribution)
|
|||||||
private fun javaScriptLink(jsFiles: List<String>, executable: String): String {
|
private fun javaScriptLink(jsFiles: List<String>, executable: String): String {
|
||||||
val linkedJavaScript = File("$executable.js")
|
val linkedJavaScript = File("$executable.js")
|
||||||
|
|
||||||
val jsLibsExceptLauncher = jsFiles.filter { it != "launcher.js" }.map { it.removeSuffix(".js") }
|
|
||||||
|
|
||||||
val linkerStub = "var konan = { libraries: [] };\n"
|
val linkerStub = "var konan = { libraries: [] };\n"
|
||||||
|
|
||||||
linkedJavaScript.writeBytes(linkerStub.toByteArray());
|
linkedJavaScript.writeBytes(linkerStub.toByteArray());
|
||||||
|
|||||||
+3
-3
@@ -1009,7 +1009,7 @@ internal class IrDeserializer(val context: Context,
|
|||||||
return IrWhenImpl(start, end, type, null, branches)
|
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()
|
val loopId = proto.getLoopId()
|
||||||
loopIndex.getOrPut(loopId){loop}
|
loopIndex.getOrPut(loopId){loop}
|
||||||
|
|
||||||
@@ -1028,7 +1028,7 @@ internal class IrDeserializer(val context: Context,
|
|||||||
// we create the loop before deserializing the body, so that
|
// we create the loop before deserializing the body, so that
|
||||||
// IrBreak statements have something to put into 'loop' field.
|
// IrBreak statements have something to put into 'loop' field.
|
||||||
val loop = IrDoWhileLoopImpl(start, end, type, null)
|
val loop = IrDoWhileLoopImpl(start, end, type, null)
|
||||||
deserializeLoop(proto.loop, start, end, type, loop)
|
deserializeLoop(proto.loop, loop)
|
||||||
return loop
|
return loop
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1036,7 +1036,7 @@ internal class IrDeserializer(val context: Context,
|
|||||||
// we create the loop before deserializing the body, so that
|
// we create the loop before deserializing the body, so that
|
||||||
// IrBreak statements have something to put into 'loop' field.
|
// IrBreak statements have something to put into 'loop' field.
|
||||||
val loop = IrWhileLoopImpl(start, end, type, null)
|
val loop = IrWhileLoopImpl(start, end, type, null)
|
||||||
deserializeLoop(proto.loop, start, end, type, loop)
|
deserializeLoop(proto.loop, loop)
|
||||||
return loop
|
return loop
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-32
@@ -54,35 +54,3 @@ fun String.removeSuffixIfPresent(suffix: String) =
|
|||||||
if (this.endsWith(suffix)) this.dropLast(suffix.length) else this
|
if (this.endsWith(suffix)) this.dropLast(suffix.length) else this
|
||||||
|
|
||||||
fun <T> Lazy<T>.getValueOrNull(): T? = if (isInitialized()) value else null
|
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