KLIB reader: comments added (#1937)

This commit is contained in:
Dmitriy Dolovov
2018-08-25 18:33:04 +03:00
committed by GitHub
parent dcb423a3ce
commit 6d8ae1650f
12 changed files with 40 additions and 0 deletions
+1
View File
@@ -34,6 +34,7 @@ repositories {
}
}
// FIXME(ddol): KLIB-REFACTORING-CLEANUP: drop generation of KonanVersion!
task generateCompilerVersion(type: VersionGenerator){}
sourceSets {
@@ -16,6 +16,8 @@
package org.jetbrains.kotlin.konan
// FIXME(ddol): KLIB-REFACTORING-CLEANUP: remove the whole file!
/**
* https://en.wikipedia.org/wiki/Software_versioning
* scheme major.minor[.build[.revision]].
@@ -16,6 +16,8 @@
package org.jetbrains.kotlin.konan.util
// FIXME(ddol): KLIB-REFACTORING-CLEANUP: remove the whole file!
val <T : Enum<T>> T.visibleName get() = name.toLowerCase()
interface Named {
val name: String
@@ -16,6 +16,8 @@
package org.jetbrains.kotlin.konan.file
// FIXME(ddol): KLIB-REFACTORING-CLEANUP: remove the whole file!
import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
@@ -6,17 +6,20 @@ import org.jetbrains.kotlin.konan.target.KonanTarget
import org.jetbrains.kotlin.konan.util.removeSuffixIfPresent
import org.jetbrains.kotlin.konan.util.suffixIfNot
// FIXME(ddol): KLIB-REFACTORING-CLEANUP: remove the constants below:
const val KLIB_FILE_EXTENSION = "klib"
const val KLIB_FILE_EXTENSION_WITH_DOT = ".$KLIB_FILE_EXTENSION"
const val KONAN_STDLIB_NAME = "stdlib"
// FIXME(ddol): KLIB-REFACTORING-CLEANUP: remove this interface!
interface SearchPathResolver {
val searchRoots: List<File>
fun resolve(givenPath: String): File
fun defaultLinks(noStdLib: Boolean, noDefaultLibs: Boolean): List<File>
}
// FIXME(ddol): KLIB-REFACTORING-CLEANUP: remove this interface!
interface SearchPathResolverWithTarget: SearchPathResolver {
val target: KonanTarget
}
@@ -16,6 +16,8 @@
package org.jetbrains.kotlin.konan.target
// FIXME(ddol): KLIB-REFACTORING-CLEANUP: remove the whole file!
import org.jetbrains.kotlin.konan.target.KonanTarget.*
import org.jetbrains.kotlin.konan.util.Named
import java.io.Serializable
@@ -16,6 +16,8 @@
package org.jetbrains.kotlin.konan.properties
// FIXME(ddol): KLIB-REFACTORING-CLEANUP: remove the whole file!
import org.jetbrains.kotlin.konan.file.*
typealias Properties = java.util.Properties
@@ -3,6 +3,8 @@ package org.jetbrains.kotlin.konan.util
import org.jetbrains.kotlin.konan.target.KonanTarget
import java.util.*
// FIXME(ddol): KLIB-REFACTORING-CLEANUP: remove the whole file!
fun defaultTargetSubstitutions(target: KonanTarget) =
mapOf<String, String>(
"target" to target.visibleName,
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.konan.util
import kotlin.system.measureTimeMillis
import org.jetbrains.kotlin.konan.file.*
// FIXME(ddol): KLIB-REFACTORING-CLEANUP: remove this function:
fun printMillisec(message: String, body: () -> Unit) {
val msec = measureTimeMillis{
body()
@@ -26,10 +27,12 @@ fun printMillisec(message: String, body: () -> Unit) {
println("$message: $msec msec")
}
// FIXME(ddol): KLIB-REFACTORING-CLEANUP: remove this function:
fun profile(message: String, body: () -> Unit) = profileIf(
System.getProperty("konan.profile")?.equals("true") ?: false,
message, body)
// FIXME(ddol): KLIB-REFACTORING-CLEANUP: remove this function:
fun profileIf(condition: Boolean, message: String, body: () -> Unit) =
if (condition) printMillisec(message, body) else body()