Support IrExpressionBody in codegen
This commit is contained in:
+7
@@ -124,6 +124,9 @@ class ExpressionCodegen(
|
|||||||
//for implicit return
|
//for implicit return
|
||||||
mv.areturn(Type.VOID_TYPE)
|
mv.areturn(Type.VOID_TYPE)
|
||||||
}
|
}
|
||||||
|
else if (irFunction.body is IrExpressionBody) {
|
||||||
|
mv.areturn(returnType)
|
||||||
|
}
|
||||||
writeLocalVariablesInTable(info)
|
writeLocalVariablesInTable(info)
|
||||||
mv.visitEnd()
|
mv.visitEnd()
|
||||||
}
|
}
|
||||||
@@ -367,6 +370,10 @@ class ExpressionCodegen(
|
|||||||
return expression.onStack
|
return expression.onStack
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun visitExpressionBody(body: IrExpressionBody, data: BlockInfo): StackValue {
|
||||||
|
return body.expression.accept(this, data)
|
||||||
|
}
|
||||||
|
|
||||||
override fun visitElement(element: IrElement, data: BlockInfo): StackValue {
|
override fun visitElement(element: IrElement, data: BlockInfo): StackValue {
|
||||||
TODO("not implemented for $element") //To change body of created functions use File | Settings | File Templates.
|
TODO("not implemented for $element") //To change body of created functions use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user