From 3476bed18a3ffb5b0084cfe3cd3e12f31577310c Mon Sep 17 00:00:00 2001 From: Alexey Tsvetkov Date: Mon, 19 Oct 2015 21:10:07 +0300 Subject: [PATCH] Drop @native from stdlib --- .../jetbrains/kotlin/codegen/AnnotationCodegen.java | 3 +-- .../src/org/jetbrains/kotlin/load/kotlin/native.kt | 5 ----- idea/src/META-INF/extensions/kotlin2jvm.xml | 2 -- libraries/stdlib/src/kotlin/jvm/JvmFlagAnnotations.kt | 11 +---------- 4 files changed, 2 insertions(+), 19 deletions(-) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/AnnotationCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/AnnotationCodegen.java index 2af194299c1..4ceada00ad9 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/AnnotationCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/AnnotationCodegen.java @@ -62,8 +62,7 @@ public abstract class AnnotationCodegen { public static final List METHOD_FLAGS = Arrays.asList( new JvmFlagAnnotation("kotlin.jvm.Strictfp", Opcodes.ACC_STRICT), - new JvmFlagAnnotation("kotlin.jvm.Synchronized", Opcodes.ACC_SYNCHRONIZED), - new JvmFlagAnnotation("kotlin.jvm.native", Opcodes.ACC_NATIVE) + new JvmFlagAnnotation("kotlin.jvm.Synchronized", Opcodes.ACC_SYNCHRONIZED) ); private static final AnnotationVisitor NO_ANNOTATION_VISITOR = new AnnotationVisitor(Opcodes.ASM5) {}; diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/load/kotlin/native.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/load/kotlin/native.kt index a79b2420222..ba89afa2b9b 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/load/kotlin/native.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/load/kotlin/native.kt @@ -29,15 +29,10 @@ import org.jetbrains.kotlin.resolve.diagnostics.SuppressDiagnosticsByAnnotations import org.jetbrains.kotlin.resolve.inline.InlineUtil import org.jetbrains.kotlin.resolve.jvm.diagnostics.ErrorsJvm -private val NATIVE_ANNOTATION_CLASS_NAME = FqName("kotlin.jvm.native") - public fun DeclarationDescriptor.hasNativeAnnotation(): Boolean { return this is FunctionDescriptor && this.isExternal - || annotations.findAnnotation(NATIVE_ANNOTATION_CLASS_NAME) != null } -public class SuppressNoBodyErrorsForNativeDeclarations : SuppressDiagnosticsByAnnotations(FUNCTION_NO_BODY_ERRORS, NATIVE_ANNOTATION_CLASS_NAME) - public class NativeFunChecker : DeclarationChecker { override fun check( declaration: JetDeclaration, diff --git a/idea/src/META-INF/extensions/kotlin2jvm.xml b/idea/src/META-INF/extensions/kotlin2jvm.xml index e8364241218..2d8dc7f878e 100644 --- a/idea/src/META-INF/extensions/kotlin2jvm.xml +++ b/idea/src/META-INF/extensions/kotlin2jvm.xml @@ -4,8 +4,6 @@ - - diff --git a/libraries/stdlib/src/kotlin/jvm/JvmFlagAnnotations.kt b/libraries/stdlib/src/kotlin/jvm/JvmFlagAnnotations.kt index 30fa040ba32..b269039b78f 100644 --- a/libraries/stdlib/src/kotlin/jvm/JvmFlagAnnotations.kt +++ b/libraries/stdlib/src/kotlin/jvm/JvmFlagAnnotations.kt @@ -54,13 +54,4 @@ public annotation class Strictfp @Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER) @Retention(AnnotationRetention.SOURCE) @MustBeDocumented -public annotation class Synchronized - -/** - * Marks the JVM method generated from the annotated function as `native`, meaning that it's not implemented - * in Java but rather in a different language (for example, in C/C++ using JNI). - */ -@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER) -@Retention(AnnotationRetention.SOURCE) -@MustBeDocumented -public annotation class native +public annotation class Synchronized \ No newline at end of file