Cleanup compilation warnings. (#1510)

This commit is contained in:
Nikolay Igotti
2018-04-18 07:32:01 +01:00
committed by GitHub
parent 94ba9d61a9
commit 0c909fea6a
4 changed files with 6 additions and 18 deletions
@@ -2194,15 +2194,12 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map<IrE
val length = varargExpression.elements.size
// TODO: store length in `vararg` itself when more abstract types will be used for values.
// `elementType` is type argument of function return type:
val elementType = callee.descriptor.returnType!!.arguments.single()
val array = constPointer(vararg)
// Note: dirty hack here: `vararg` has type `Array<out E>`, but `createArrayList` expects `Array<E>`;
// however `vararg` is immutable, and in current implementation it has type `Array<E>`,
// so let's ignore this mismatch currently for simplicity.
return context.llvm.staticData.createArrayList(elementType, array, length).llvm
return context.llvm.staticData.createArrayList(array, length).llvm
}
else -> TODO(callee.descriptor.original.toString())
@@ -111,7 +111,7 @@ private fun StaticData.getArrayListClass(): ClassDescriptor {
* @param array value for `array: Array<E>` field.
* @param length value for `length: Int` field.
*/
internal fun StaticData.createArrayList(elementType: TypeProjection, array: ConstPointer, length: Int): ConstPointer {
internal fun StaticData.createArrayList(array: ConstPointer, length: Int): ConstPointer {
val arrayListClass = context.ir.symbols.arrayList.owner
val arrayListFqName = arrayListClass.fqNameSafe
@@ -722,7 +722,7 @@ internal class IrDeserializer(val context: Context,
private fun deserializeTypeArguments(proto: KonanIr.TypeArguments): List<KotlinType> {
context.log{"### deserializeTypeArguments"}
val result = mutableListOf<KotlinType>()
proto.typeArgumentList.forEachIndexed { index, type ->
proto.typeArgumentList.forEach { type ->
val kotlinType = deserializeKotlinType(type)
result.add(kotlinType)
context.log{"$kotlinType"}
@@ -829,8 +829,6 @@ internal class IrDeserializer(val context: Context,
deserializeDescriptor(proto.`super`) as ClassDescriptor
} else null
val typeArgs = deserializeTypeArguments(proto.memberAccess.typeArguments)
val call: IrCall = when (proto.kind) {
KonanIr.IrCall.Primitive.NOT_PRIMITIVE ->
// TODO: implement the last three args here.
@@ -856,8 +854,8 @@ internal class IrDeserializer(val context: Context,
else -> TODO()
}
deserializeTypeArguments(proto.typeArguments).forEachIndexed { index, type ->
callable.putTypeArgument(index, type)
deserializeTypeArguments(proto.typeArguments).forEachIndexed { index, argType ->
callable.putTypeArgument(index, argType)
}
return callable
}
@@ -879,13 +877,6 @@ internal class IrDeserializer(val context: Context,
return call
}
fun deserializeEnumConstructorCall(proto: KonanIr.IrEnumConstructorCall, start: Int, end: Int): IrEnumConstructorCall {
val descriptor = deserializeDescriptor(proto.descriptor) as ClassConstructorDescriptor
val call = IrEnumConstructorCallImpl(start, end, IrConstructorSymbolImpl(descriptor), null)
deserializeMemberAccessCommon(call, proto.memberAccess)
return call
}
private fun deserializeGetClass(proto: KonanIr.IrGetClass, start: Int, end: Int, type: KotlinType): IrGetClass {
val argument = deserializeExpression(proto.argument)
return IrGetClassImpl(start, end, type, argument)
@@ -261,7 +261,7 @@ open class KonanSoftwareComponent(val project: ProjectInternal?): SoftwareCompon
private val variants = mutableSetOf<SoftwareComponent>()
override fun getName() = "main"
override fun getVariants(): Set<out SoftwareComponent> = variants
override fun getVariants(): Set<SoftwareComponent> = variants
fun addVariant(component: SoftwareComponent) = variants.add(component)
}