Exclude local variables and try catch blocks of non-inline functions from ABI

This commit is contained in:
Alexey Tsvetkov
2018-12-11 22:42:37 +03:00
parent 495cfec9e9
commit 57f8f216d1
2 changed files with 10 additions and 1 deletions
@@ -19,5 +19,7 @@ internal class ReplaceWithEmptyMethodVisitor(
) : TransformationMethodVisitor(delegate, access, name, desc, signature, exceptions, api = ABI_EXTENSION_ASM_API_VERSION) {
override fun performTransformations(methodNode: MethodNode) {
methodNode.instructions.clear()
methodNode.localVariables.clear()
methodNode.tryCatchBlocks.clear()
}
}
@@ -1,3 +1,10 @@
package test
fun sum(x: Int, y: Int): Int = x + y
fun sum(x: Int, y: Int): Int =
try {
var result = x
result += y
result
} finally {
// do nothing
}