Fix warnings in K/Native code
This commit is contained in:
committed by
Space
parent
0a5991d6e7
commit
ca9cbf7eb7
+4
@@ -175,6 +175,8 @@ abstract class StructDef(val size: Long, val align: Int) {
|
|||||||
when (it) {
|
when (it) {
|
||||||
is Field -> add(it)
|
is Field -> add(it)
|
||||||
is AnonymousInnerRecord -> addAll(it.def.fields)
|
is AnonymousInnerRecord -> addAll(it.def.fields)
|
||||||
|
is BitField,
|
||||||
|
is IncompleteField -> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -185,6 +187,8 @@ abstract class StructDef(val size: Long, val align: Int) {
|
|||||||
when (it) {
|
when (it) {
|
||||||
is BitField -> add(it)
|
is BitField -> add(it)
|
||||||
is AnonymousInnerRecord -> addAll(it.def.bitFields)
|
is AnonymousInnerRecord -> addAll(it.def.bitFields)
|
||||||
|
is Field,
|
||||||
|
is IncompleteField -> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -241,6 +241,8 @@ fun StructDef.fieldsHaveDefaultAlignment(): Boolean {
|
|||||||
offset = it.offset / 8 + it.typeSize
|
offset = it.offset / 8 + it.typeSize
|
||||||
}
|
}
|
||||||
is BitField -> return false
|
is BitField -> return false
|
||||||
|
is AnonymousInnerRecord,
|
||||||
|
is IncompleteField -> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
@@ -156,6 +156,7 @@ class StubIrBridgeBuilder(
|
|||||||
val getAddressExpression = getGlobalAddressExpression(extra.cGlobalName, propertyAccessor)
|
val getAddressExpression = getGlobalAddressExpression(extra.cGlobalName, propertyAccessor)
|
||||||
propertyAccessorBridgeBodies[propertyAccessor] = typeInfo.argFromBridged(getAddressExpression, kotlinFile, nativeBacked = propertyAccessor) + "!!"
|
propertyAccessorBridgeBodies[propertyAccessor] = typeInfo.argFromBridged(getAddressExpression, kotlinFile, nativeBacked = propertyAccessor) + "!!"
|
||||||
}
|
}
|
||||||
|
else -> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,6 +188,7 @@ class StubIrBridgeBuilder(
|
|||||||
}
|
}
|
||||||
propertyAccessorBridgeBodies[propertyAccessor] = setter
|
propertyAccessorBridgeBodies[propertyAccessor] = setter
|
||||||
}
|
}
|
||||||
|
else -> {}
|
||||||
}
|
}
|
||||||
|
|
||||||
is PropertyAccessor.Setter.WriteBits -> {
|
is PropertyAccessor.Setter.WriteBits -> {
|
||||||
@@ -223,6 +225,11 @@ class StubIrBridgeBuilder(
|
|||||||
simpleBridgeGenerator.insertNativeBridge(propertyAccessor, emptyList(), wrapper.lines)
|
simpleBridgeGenerator.insertNativeBridge(propertyAccessor, emptyList(), wrapper.lines)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
is PropertyAccessor.Getter.ArrayMemberAt,
|
||||||
|
is PropertyAccessor.Getter.GetConstructorParameter,
|
||||||
|
is PropertyAccessor.Getter.GetEnumEntry,
|
||||||
|
is PropertyAccessor.Getter.MemberAt,
|
||||||
|
is PropertyAccessor.Setter.MemberAt -> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
@@ -179,6 +179,7 @@ internal fun produceOutput(context: Context) {
|
|||||||
context.bitcodeFileName = output
|
context.bitcodeFileName = output
|
||||||
LLVMWriteBitcodeToFile(context.llvmModule!!, output)
|
LLVMWriteBitcodeToFile(context.llvmModule!!, output)
|
||||||
}
|
}
|
||||||
|
null -> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -126,5 +126,5 @@ internal class FileInitializersLowering(val context: Context) : FileLoweringPass
|
|||||||
}
|
}
|
||||||
|
|
||||||
private val IrField.hasNonConstInitializer: Boolean
|
private val IrField.hasNonConstInitializer: Boolean
|
||||||
get() = initializer.let { it != null && it !is IrConst<*> }
|
get() = initializer?.expression.let { it != null && it !is IrConst<*> }
|
||||||
}
|
}
|
||||||
+1
-4
@@ -758,9 +758,7 @@ internal class ModuleDFGBuilder(val context: Context, val irModule: IrModuleFrag
|
|||||||
else
|
else
|
||||||
it
|
it
|
||||||
}
|
}
|
||||||
if (callee is IrConstructor) {
|
|
||||||
error("Constructor call should be done with IrConstructorCall")
|
|
||||||
} else {
|
|
||||||
if (value.isVirtualCall) {
|
if (value.isVirtualCall) {
|
||||||
val owner = callee.parentAsClass
|
val owner = callee.parentAsClass
|
||||||
val actualReceiverType = value.dispatchReceiver!!.type
|
val actualReceiverType = value.dispatchReceiver!!.type
|
||||||
@@ -821,7 +819,6 @@ internal class ModuleDFGBuilder(val context: Context, val irModule: IrModuleFrag
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
is IrDelegatingConstructorCall -> {
|
is IrDelegatingConstructorCall -> {
|
||||||
val thisReceiver = (declaration as IrConstructor).constructedClass.thisReceiver!!
|
val thisReceiver = (declaration as IrConstructor).constructedClass.thisReceiver!!
|
||||||
|
|||||||
+7
@@ -231,6 +231,13 @@ internal object EscapeAnalysis {
|
|||||||
for (value in node.values)
|
for (value in node.values)
|
||||||
assignRole(node, Role.ASSIGNED, RoleInfoEntry(value.node, null))
|
assignRole(node, Role.ASSIGNED, RoleInfoEntry(value.node, null))
|
||||||
}
|
}
|
||||||
|
is DataFlowIR.Node.AllocInstance,
|
||||||
|
is DataFlowIR.Node.Call,
|
||||||
|
is DataFlowIR.Node.Const,
|
||||||
|
is DataFlowIR.Node.FunctionReference,
|
||||||
|
is DataFlowIR.Node.Null,
|
||||||
|
is DataFlowIR.Node.Parameter,
|
||||||
|
is DataFlowIR.Node.Scope -> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FunctionAnalysisResult(function, nodesRoles)
|
FunctionAnalysisResult(function, nodesRoles)
|
||||||
|
|||||||
+5
@@ -136,6 +136,11 @@ internal object LocalEscapeAnalysis {
|
|||||||
is DataFlowIR.Node.Parameter -> {
|
is DataFlowIR.Node.Parameter -> {
|
||||||
node.escapeState = EscapeState.ARG_ESCAPE
|
node.escapeState = EscapeState.ARG_ESCAPE
|
||||||
}
|
}
|
||||||
|
is DataFlowIR.Node.AllocInstance,
|
||||||
|
is DataFlowIR.Node.Const,
|
||||||
|
is DataFlowIR.Node.FunctionReference,
|
||||||
|
is DataFlowIR.Node.Null,
|
||||||
|
is DataFlowIR.Node.Scope -> {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user