is<Annotation>() made static in KotlinBuiltIns

This commit is contained in:
Andrey Breslav
2014-12-02 16:07:09 +03:00
parent db635c0e44
commit b275b363c9
11 changed files with 41 additions and 39 deletions
@@ -289,11 +289,11 @@ public class AsmUtil {
public static int getDeprecatedAccessFlag(@NotNull MemberDescriptor descriptor) {
if (descriptor instanceof PropertyAccessorDescriptor) {
return KotlinBuiltIns.getInstance().isDeprecated(descriptor)
return KotlinBuiltIns.isDeprecated(descriptor)
? ACC_DEPRECATED
: getDeprecatedAccessFlag(((PropertyAccessorDescriptor) descriptor).getCorrespondingProperty());
}
else if (KotlinBuiltIns.getInstance().isDeprecated(descriptor)) {
else if (KotlinBuiltIns.isDeprecated(descriptor)) {
return ACC_DEPRECATED;
}
return 0;
@@ -183,7 +183,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
if (isAnnotation) {
access |= ACC_ANNOTATION;
}
if (KotlinBuiltIns.getInstance().isDeprecated(descriptor)) {
if (KotlinBuiltIns.isDeprecated(descriptor)) {
access |= ACC_DEPRECATED;
}
if (isEnum) {
@@ -514,7 +514,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
}
private void generateFunctionsForDataClasses() {
if (!KotlinBuiltIns.getInstance().isData(descriptor)) return;
if (!KotlinBuiltIns.isData(descriptor)) return;
new DataClassMethodGeneratorImpl(myClass, bindingContext).generate();
}
@@ -797,7 +797,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
new DefaultParameterValueLoader() {
@Override
public StackValue genValue(ValueParameterDescriptor valueParameter, ExpressionCodegen codegen) {
assert KotlinBuiltIns.getInstance().isData((ClassDescriptor) function.getContainingDeclaration())
assert KotlinBuiltIns.isData((ClassDescriptor) function.getContainingDeclaration())
: "Function container should be annotated with [data]: " + function;
PropertyDescriptor property = bindingContext.get(BindingContext.VALUE_PARAMETER_AS_PROPERTY, valueParameter);
assert property != null : "Copy function doesn't correspond to any property: " + function;
@@ -745,7 +745,7 @@ public class JetFlowInformationProvider {
public void markTailCalls() {
final DeclarationDescriptor subroutineDescriptor = trace.get(BindingContext.DECLARATION_TO_DESCRIPTOR, subroutine);
if (!(subroutineDescriptor instanceof FunctionDescriptor)) return;
if (!KotlinBuiltIns.getInstance().isTailRecursive(subroutineDescriptor)) return;
if (!KotlinBuiltIns.isTailRecursive(subroutineDescriptor)) return;
// finally blocks are copied which leads to multiple diagnostics reported on one instruction
class KindAndCall {
@@ -227,7 +227,7 @@ public class DeclarationResolver {
JetClassOrObject klass = entry.getKey();
MutableClassDescriptor classDescriptor = (MutableClassDescriptor) entry.getValue();
if (klass instanceof JetClass && KotlinBuiltIns.getInstance().isData(classDescriptor)) {
if (klass instanceof JetClass && KotlinBuiltIns.isData(classDescriptor)) {
List<ValueParameterDescriptor> parameters =
klass.hasPrimaryConstructor() ?
getConstructorOfDataClass(classDescriptor).getValueParameters() :
@@ -130,7 +130,7 @@ public open class LazyClassMemberScope(resolveSession: ResolveSession,
}
private fun generateDataClassMethods(result: MutableCollection<FunctionDescriptor>, name: Name) {
if (!KotlinBuiltIns.getInstance().isData(thisDescriptor)) return
if (!KotlinBuiltIns.isData(thisDescriptor)) return
val constructor = getPrimaryConstructor()
if (constructor == null) return
@@ -240,7 +240,7 @@ public open class LazyClassMemberScope(resolveSession: ResolveSession,
}
private fun addDataClassMethods(result: MutableCollection<DeclarationDescriptor>) {
if (!KotlinBuiltIns.getInstance().isData(thisDescriptor)) return
if (!KotlinBuiltIns.isData(thisDescriptor)) return
if (getPrimaryConstructor() == null) return