Move Kotlin version to 1.1.4, fix some warnings. (#802)
This commit is contained in:
+9
-5
@@ -139,10 +139,10 @@ internal fun visitChildren(parent: CValue<CXCursor>, visitor: CursorVisitor) {
|
|||||||
val visitorPtr = StableObjPtr.create(visitor)
|
val visitorPtr = StableObjPtr.create(visitor)
|
||||||
try {
|
try {
|
||||||
val clientData = visitorPtr.value
|
val clientData = visitorPtr.value
|
||||||
clang_visitChildren(parent, staticCFunction { cursor, parent, clientData ->
|
clang_visitChildren(parent, staticCFunction { cursorIt, parentIt, clientDataIt ->
|
||||||
@Suppress("NAME_SHADOWING", "UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
val visitor = StableObjPtr.fromValue(clientData!!).get() as CursorVisitor
|
val visitorIt = StableObjPtr.fromValue(clientDataIt!!).get() as CursorVisitor
|
||||||
visitor(cursor, parent)
|
visitorIt(cursorIt, parentIt)
|
||||||
}, clientData)
|
}, clientData)
|
||||||
} finally {
|
} finally {
|
||||||
visitorPtr.dispose()
|
visitorPtr.dispose()
|
||||||
@@ -345,16 +345,20 @@ internal fun indexTranslationUnit(index: CXIndex, translationUnit: CXTranslation
|
|||||||
val indexerCallbacks = alloc<IndexerCallbacks>().apply {
|
val indexerCallbacks = alloc<IndexerCallbacks>().apply {
|
||||||
abortQuery = null
|
abortQuery = null
|
||||||
diagnostic = null
|
diagnostic = null
|
||||||
enteredMainFile = staticCFunction { clientData, mainFile, reserved ->
|
enteredMainFile = staticCFunction { clientData, mainFile, _ ->
|
||||||
@Suppress("NAME_SHADOWING")
|
@Suppress("NAME_SHADOWING")
|
||||||
val indexer = StableObjPtr.fromValue(clientData!!).get() as Indexer
|
val indexer = StableObjPtr.fromValue(clientData!!).get() as Indexer
|
||||||
indexer.enteredMainFile(mainFile!!)
|
indexer.enteredMainFile(mainFile!!)
|
||||||
|
// We must ensure only interop types exist in function signature.
|
||||||
|
@Suppress("USELESS_CAST")
|
||||||
null as CXIdxClientFile?
|
null as CXIdxClientFile?
|
||||||
}
|
}
|
||||||
ppIncludedFile = staticCFunction { clientData, info ->
|
ppIncludedFile = staticCFunction { clientData, info ->
|
||||||
@Suppress("NAME_SHADOWING")
|
@Suppress("NAME_SHADOWING")
|
||||||
val indexer = StableObjPtr.fromValue(clientData!!).get() as Indexer
|
val indexer = StableObjPtr.fromValue(clientData!!).get() as Indexer
|
||||||
indexer.ppIncludedFile(info!!.pointed)
|
indexer.ppIncludedFile(info!!.pointed)
|
||||||
|
// We must ensure only interop types exist in function signature.
|
||||||
|
@Suppress("USELESS_CAST")
|
||||||
null as CXIdxClientFile?
|
null as CXIdxClientFile?
|
||||||
}
|
}
|
||||||
importedASTFile = null
|
importedASTFile = null
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ private fun createStaticCFunctionImpl(
|
|||||||
val impl: FfiClosureImpl = when (arity) {
|
val impl: FfiClosureImpl = when (arity) {
|
||||||
0 -> {
|
0 -> {
|
||||||
val f = function as () -> Any?
|
val f = function as () -> Any?
|
||||||
ffiClosureImpl(returnType) { args ->
|
ffiClosureImpl(returnType) { _ ->
|
||||||
f()
|
f()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -123,7 +123,7 @@ class MappingBridgeGeneratorImpl(
|
|||||||
|
|
||||||
val bridgeArguments = mutableListOf<BridgeTypedNativeValue>()
|
val bridgeArguments = mutableListOf<BridgeTypedNativeValue>()
|
||||||
|
|
||||||
nativeValues.forEachIndexed { index, (type, value) ->
|
nativeValues.forEachIndexed { _, (type, value) ->
|
||||||
val bridgeArgument = if (type.unwrapTypedefs() is RecordType) {
|
val bridgeArgument = if (type.unwrapTypedefs() is RecordType) {
|
||||||
BridgeTypedNativeValue(BridgedType.NATIVE_PTR, "&$value")
|
BridgeTypedNativeValue(BridgedType.NATIVE_PTR, "&$value")
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@ private fun ObjCMethod.getKotlinParameterNames(): List<String> {
|
|||||||
val result = mutableListOf<String>()
|
val result = mutableListOf<String>()
|
||||||
|
|
||||||
// The names of all parameters except first must depend only on the selector:
|
// The names of all parameters except first must depend only on the selector:
|
||||||
this.parameters.forEachIndexed { index, parameter ->
|
this.parameters.forEachIndexed { index, _ ->
|
||||||
if (index > 0) {
|
if (index > 0) {
|
||||||
var name = selectorParts[index]
|
var name = selectorParts[index]
|
||||||
if (name.isEmpty()) {
|
if (name.isEmpty()) {
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import kotlin.reflect.KFunction
|
|||||||
private fun maybeExecuteHelper(targetName: String) {
|
private fun maybeExecuteHelper(targetName: String) {
|
||||||
try {
|
try {
|
||||||
val kClass = Class.forName("org.jetbrains.kotlin.konan.Helper0").kotlin
|
val kClass = Class.forName("org.jetbrains.kotlin.konan.Helper0").kotlin
|
||||||
|
@Suppress("UNCHECKED_CAST")
|
||||||
val ctor = kClass.constructors.single() as KFunction<Runnable>
|
val ctor = kClass.constructors.single() as KFunction<Runnable>
|
||||||
val distribution = Distribution(TargetManager(targetName))
|
val distribution = Distribution(TargetManager(targetName))
|
||||||
val result = ctor.call(
|
val result = ctor.call(
|
||||||
|
|||||||
+1
-1
@@ -127,7 +127,7 @@ internal fun produceOutput(context: Context) {
|
|||||||
llvmModule,
|
llvmModule,
|
||||||
nopack,
|
nopack,
|
||||||
manifest,
|
manifest,
|
||||||
context.moduleEscapeAnalysisResult?.build()?.toByteArray())
|
context.moduleEscapeAnalysisResult.build().toByteArray())
|
||||||
|
|
||||||
context.library = library
|
context.library = library
|
||||||
context.bitcodeFileName = library.mainBitcodeFileName
|
context.bitcodeFileName = library.mainBitcodeFileName
|
||||||
|
|||||||
+1
-1
@@ -150,7 +150,7 @@ internal fun structType(types: List<LLVMTypeRef>): LLVMTypeRef =
|
|||||||
|
|
||||||
internal fun ContextUtils.numParameters(functionType: LLVMTypeRef) : Int {
|
internal fun ContextUtils.numParameters(functionType: LLVMTypeRef) : Int {
|
||||||
// Note that type is usually function pointer, so we have to dereference it.
|
// Note that type is usually function pointer, so we have to dereference it.
|
||||||
return LLVMCountParamTypes(LLVMGetElementType(functionType))!!
|
return LLVMCountParamTypes(LLVMGetElementType(functionType))
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun ContextUtils.isObjectReturn(functionType: LLVMTypeRef) : Boolean {
|
internal fun ContextUtils.isObjectReturn(functionType: LLVMTypeRef) : Boolean {
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
kotlin_version=1.1.3
|
kotlin_version=1.1.4
|
||||||
llvmVersion = 3.9.0
|
llvmVersion = 3.9.0
|
||||||
remoteRoot=konan_tests
|
remoteRoot=konan_tests
|
||||||
#kotlinCompilerModule=org.jetbrains.kotlin:kotlin-compiler:1.1-SNAPSHOT
|
#kotlinCompilerModule=org.jetbrains.kotlin:kotlin-compiler:1.1-SNAPSHOT
|
||||||
|
|||||||
Reference in New Issue
Block a user