[JS IR BE] Remove no longer needed descriptor based utils

This commit is contained in:
Zalim Bashorov
2018-07-23 21:57:08 +03:00
parent 990ad8719d
commit c66bb8c57d
@@ -9,38 +9,13 @@ import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.descriptors.PropertyAccessorDescriptor
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.ir.declarations.IrTypeParameter
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.types.KotlinType
val IrConstructorSymbol.constructedClass get() = descriptor.constructedClass
val IrClassSymbol.isAny get() = KotlinBuiltIns.isAny(descriptor)
fun ModuleDescriptor.getFunctions(fqName: FqName): List<FunctionDescriptor> {
return getFunctions(fqName.parent(), fqName.shortName())
}
fun ModuleDescriptor.getFunctions(packageFqName: FqName, name: Name): List<FunctionDescriptor> {
return getPackage(packageFqName).memberScope.getContributedFunctions(name, NoLookupLocation.FROM_BACKEND).toList()
}
fun ModuleDescriptor.getClassifier(fqName: FqName): ClassifierDescriptor? {
return getClassifier(fqName.parent(), fqName.shortName())
}
fun ModuleDescriptor.getClassifier(packageFqName: FqName, name: Name): ClassifierDescriptor? {
return getPackage(packageFqName).memberScope.getContributedClassifier(name, NoLookupLocation.FROM_BACKEND)
}
fun createValueParameter(containingDeclaration: CallableDescriptor, index: Int, name: String, type: KotlinType): ValueParameterDescriptor {
return ValueParameterDescriptorImpl(
containingDeclaration = containingDeclaration,