Move Kotlin version to 1.1.4, fix some warnings. (#802)

This commit is contained in:
Nikolay Igotti
2017-08-22 14:50:05 +03:00
committed by GitHub
parent 9402a9c6a2
commit 87f2bed5c8
8 changed files with 16 additions and 11 deletions
@@ -139,10 +139,10 @@ internal fun visitChildren(parent: CValue<CXCursor>, visitor: CursorVisitor) {
val visitorPtr = StableObjPtr.create(visitor)
try {
val clientData = visitorPtr.value
clang_visitChildren(parent, staticCFunction { cursor, parent, clientData ->
@Suppress("NAME_SHADOWING", "UNCHECKED_CAST")
val visitor = StableObjPtr.fromValue(clientData!!).get() as CursorVisitor
visitor(cursor, parent)
clang_visitChildren(parent, staticCFunction { cursorIt, parentIt, clientDataIt ->
@Suppress("UNCHECKED_CAST")
val visitorIt = StableObjPtr.fromValue(clientDataIt!!).get() as CursorVisitor
visitorIt(cursorIt, parentIt)
}, clientData)
} finally {
visitorPtr.dispose()
@@ -345,16 +345,20 @@ internal fun indexTranslationUnit(index: CXIndex, translationUnit: CXTranslation
val indexerCallbacks = alloc<IndexerCallbacks>().apply {
abortQuery = null
diagnostic = null
enteredMainFile = staticCFunction { clientData, mainFile, reserved ->
enteredMainFile = staticCFunction { clientData, mainFile, _ ->
@Suppress("NAME_SHADOWING")
val indexer = StableObjPtr.fromValue(clientData!!).get() as Indexer
indexer.enteredMainFile(mainFile!!)
// We must ensure only interop types exist in function signature.
@Suppress("USELESS_CAST")
null as CXIdxClientFile?
}
ppIncludedFile = staticCFunction { clientData, info ->
@Suppress("NAME_SHADOWING")
val indexer = StableObjPtr.fromValue(clientData!!).get() as Indexer
indexer.ppIncludedFile(info!!.pointed)
// We must ensure only interop types exist in function signature.
@Suppress("USELESS_CAST")
null as CXIdxClientFile?
}
importedASTFile = null
@@ -258,7 +258,7 @@ private fun createStaticCFunctionImpl(
val impl: FfiClosureImpl = when (arity) {
0 -> {
val f = function as () -> Any?
ffiClosureImpl(returnType) { args ->
ffiClosureImpl(returnType) { _ ->
f()
}
}
@@ -123,7 +123,7 @@ class MappingBridgeGeneratorImpl(
val bridgeArguments = mutableListOf<BridgeTypedNativeValue>()
nativeValues.forEachIndexed { index, (type, value) ->
nativeValues.forEachIndexed { _, (type, value) ->
val bridgeArgument = if (type.unwrapTypedefs() is RecordType) {
BridgeTypedNativeValue(BridgedType.NATIVE_PTR, "&$value")
} else {
@@ -25,7 +25,7 @@ private fun ObjCMethod.getKotlinParameterNames(): List<String> {
val result = mutableListOf<String>()
// 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) {
var name = selectorParts[index]
if (name.isEmpty()) {
@@ -39,6 +39,7 @@ import kotlin.reflect.KFunction
private fun maybeExecuteHelper(targetName: String) {
try {
val kClass = Class.forName("org.jetbrains.kotlin.konan.Helper0").kotlin
@Suppress("UNCHECKED_CAST")
val ctor = kClass.constructors.single() as KFunction<Runnable>
val distribution = Distribution(TargetManager(targetName))
val result = ctor.call(
@@ -127,7 +127,7 @@ internal fun produceOutput(context: Context) {
llvmModule,
nopack,
manifest,
context.moduleEscapeAnalysisResult?.build()?.toByteArray())
context.moduleEscapeAnalysisResult.build().toByteArray())
context.library = library
context.bitcodeFileName = library.mainBitcodeFileName
@@ -150,7 +150,7 @@ internal fun structType(types: List<LLVMTypeRef>): LLVMTypeRef =
internal fun ContextUtils.numParameters(functionType: LLVMTypeRef) : Int {
// 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 {
+1 -1
View File
@@ -14,7 +14,7 @@
# limitations under the License.
#
kotlin_version=1.1.3
kotlin_version=1.1.4
llvmVersion = 3.9.0
remoteRoot=konan_tests
#kotlinCompilerModule=org.jetbrains.kotlin:kotlin-compiler:1.1-SNAPSHOT