Minor. Reformat

This commit is contained in:
Mikhael Bogdanov
2018-05-17 12:20:20 +02:00
parent 11653c6800
commit 083bcade5f
@@ -39,10 +39,10 @@ import org.jetbrains.kotlin.psi2ir.PsiSourceManager
import org.jetbrains.kotlin.resolve.scopes.MemberScope import org.jetbrains.kotlin.resolve.scopes.MemberScope
class JvmBackendContext( class JvmBackendContext(
val state: GenerationState, val state: GenerationState,
psiSourceManager: PsiSourceManager, psiSourceManager: PsiSourceManager,
override val irBuiltIns: IrBuiltIns, override val irBuiltIns: IrBuiltIns,
irModuleFragment: IrModuleFragment, symbolTable: SymbolTable irModuleFragment: IrModuleFragment, symbolTable: SymbolTable
) : CommonBackendContext { ) : CommonBackendContext {
override val builtIns = state.module.builtIns override val builtIns = state.module.builtIns
override val descriptorsFactory: JvmDescriptorsFactory = JvmDescriptorsFactory(psiSourceManager, builtIns) override val descriptorsFactory: JvmDescriptorsFactory = JvmDescriptorsFactory(psiSourceManager, builtIns)
@@ -53,31 +53,34 @@ class JvmBackendContext(
} }
override val ir: Ir<CommonBackendContext> = object : Ir<CommonBackendContext>(this, irModuleFragment) { override val ir: Ir<CommonBackendContext> = object : Ir<CommonBackendContext>(this, irModuleFragment) {
override val symbols: Symbols<CommonBackendContext> = object: Symbols<CommonBackendContext>(this@JvmBackendContext, symbolTable) { override val symbols: Symbols<CommonBackendContext> = object : Symbols<CommonBackendContext>(this@JvmBackendContext, symbolTable) {
override val areEqual override val areEqual
get () = symbolTable.referenceSimpleFunction(context.getInternalFunctions("areEqual").single()) get () = symbolTable.referenceSimpleFunction(context.getInternalFunctions("areEqual").single())
override val ThrowNullPointerException override val ThrowNullPointerException
get () = symbolTable.referenceSimpleFunction( get () = symbolTable.referenceSimpleFunction(
context.getInternalFunctions("ThrowNullPointerException").single()) context.getInternalFunctions("ThrowNullPointerException").single()
)
override val ThrowNoWhenBranchMatchedException override val ThrowNoWhenBranchMatchedException
get () = symbolTable.referenceSimpleFunction( get () = symbolTable.referenceSimpleFunction(
context.getInternalFunctions("ThrowNoWhenBranchMatchedException").single()) context.getInternalFunctions("ThrowNoWhenBranchMatchedException").single()
)
override val ThrowTypeCastException override val ThrowTypeCastException
get () = symbolTable.referenceSimpleFunction( get () = symbolTable.referenceSimpleFunction(
context.getInternalFunctions("ThrowTypeCastException").single()) context.getInternalFunctions("ThrowTypeCastException").single()
)
override val ThrowUninitializedPropertyAccessException override val ThrowUninitializedPropertyAccessException
get () = symbolTable.referenceSimpleFunction( get () = symbolTable.referenceSimpleFunction(
context.getInternalFunctions("ThrowUninitializedPropertyAccessException").single() context.getInternalFunctions("ThrowUninitializedPropertyAccessException").single()
) )
override val stringBuilder override val stringBuilder
get() = symbolTable.referenceClass( get() = symbolTable.referenceClass(
context.getClass(FqName("java.lang.StringBuilder")) context.getClass(FqName("java.lang.StringBuilder"))
) )
override val copyRangeTo: Map<ClassDescriptor, IrSimpleFunctionSymbol> override val copyRangeTo: Map<ClassDescriptor, IrSimpleFunctionSymbol>
@@ -110,8 +113,10 @@ class JvmBackendContext(
override fun getInternalFunctions(name: String): List<FunctionDescriptor> { override fun getInternalFunctions(name: String): List<FunctionDescriptor> {
return when (name) { return when (name) {
"ThrowUninitializedPropertyAccessException" -> "ThrowUninitializedPropertyAccessException" ->
getInternalClass("Intrinsics").staticScope. getInternalClass("Intrinsics").staticScope.getContributedFunctions(
getContributedFunctions(Name.identifier("throwUninitializedPropertyAccessException"), NoLookupLocation.FROM_BACKEND).toList() Name.identifier("throwUninitializedPropertyAccessException"),
NoLookupLocation.FROM_BACKEND
).toList()
else -> TODO(name) else -> TODO(name)
} }
} }