Jvm backend: specify declaration origin of generated methods
Allow to distinguish collection stub methods and augmented kotlin api methods
This commit is contained in:
@@ -36,7 +36,7 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameUnsafe
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.getAllSuperclassesWithoutAny
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.overriddenTreeUniqueAsSequence
|
||||
import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin
|
||||
import org.jetbrains.kotlin.resolve.jvm.diagnostics.CollectionStub
|
||||
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodGenericSignature
|
||||
import org.jetbrains.kotlin.types.*
|
||||
import org.jetbrains.kotlin.types.checker.KotlinTypeChecker
|
||||
@@ -337,7 +337,7 @@ class CollectionStubMethodGenerator(
|
||||
val access = ACC_PUBLIC or (if (synthetic) ACC_SYNTHETIC else 0)
|
||||
val asmMethod = signature.asmMethod
|
||||
val genericSignature = if (synthetic) null else signature.genericsSignature
|
||||
val mv = v.newMethod(JvmDeclarationOrigin.NO_ORIGIN, access, asmMethod.name, asmMethod.descriptor, genericSignature, null)
|
||||
val mv = v.newMethod(CollectionStub, access, asmMethod.name, asmMethod.descriptor, genericSignature, null)
|
||||
mv.visitCode()
|
||||
AsmUtil.genThrow(
|
||||
InstructionAdapter(mv),
|
||||
|
||||
@@ -839,7 +839,7 @@ public class FunctionCodegen {
|
||||
if (!isThereOverriddenInKotlinClass(descriptor)) {
|
||||
Method method = typeMapper.mapAsmMethod(descriptor);
|
||||
int flags = ACC_ABSTRACT | getVisibilityAccessFlag(descriptor);
|
||||
v.newMethod(JvmDeclarationOriginKt.OtherOrigin(overridden), flags, method.getName(), method.getDescriptor(), null, null);
|
||||
v.newMethod(JvmDeclarationOriginKt.AugmentedBuiltInApi(overridden), flags, method.getName(), method.getDescriptor(), null, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user