JVM IR: generate ACC_SYNTHETIC for deprecated-hidden declarations correctly

Extract the logic that computes ACC_SYNTHETIC flag for deprecated
declarations, and use `DeprecationResolver` as the old backend does in
`DescriptorAsmUtil.getCommonCallableFlags`. Creating IR-based
descriptors for each function to pass it there is a bit costly though,
so as a small optimization, use `allOverridden` to check if anything in
the method hierarchy is deprecated.

Also optimize `allOverridden` for the case of linear inheritance which
is far more common.

 #KT-43199 Fixed
This commit is contained in:
Alexander Udalov
2020-11-06 17:26:03 +01:00
committed by Alexander Udalov
parent d9efc2d922
commit 0e91d3fcb0
8 changed files with 110 additions and 45 deletions
@@ -757,6 +757,11 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest {
public void testDeprecatedProperty() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/deprecated/deprecatedProperty.kt");
}
@TestMetadata("hidden.kt")
public void testHidden() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/deprecated/hidden.kt");
}
}
@TestMetadata("compiler/testData/codegen/bytecodeListing/inline")
@@ -727,6 +727,11 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes
public void testDeprecatedProperty() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/deprecated/deprecatedProperty.kt");
}
@TestMetadata("hidden.kt")
public void testHidden() throws Exception {
runTest("compiler/testData/codegen/bytecodeListing/deprecated/hidden.kt");
}
}
@TestMetadata("compiler/testData/codegen/bytecodeListing/inline")