From ed440fc060188ca1cb1c98a666a945d34ac61218 Mon Sep 17 00:00:00 2001 From: Anton Bannykh Date: Thu, 21 Mar 2019 15:29:00 +0300 Subject: [PATCH] JS IR: remove obsolete hack from SymbolTable --- .../jetbrains/kotlin/ir/util/SymbolTable.kt | 56 ------------------- 1 file changed, 56 deletions(-) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/SymbolTable.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/SymbolTable.kt index f730df3f04a..5384a37e6b5 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/SymbolTable.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/SymbolTable.kt @@ -504,62 +504,6 @@ open class SymbolTable : ReferenceSymbolTable { else -> throw IllegalArgumentException("Unexpected value descriptor: $value") } - - fun loadModule(module: IrModuleFragment) { - module.acceptVoid(object: IrElementVisitorVoid { - override fun visitElement(element: IrElement) { - element.acceptChildrenVoid(this) - } - - override fun visitClass(declaration: IrClass) { - // TODO should we check there are no conflicts? - classSymbolTable.descriptorToSymbol[declaration.descriptor] = declaration.symbol - super.visitClass(declaration) - } - - override fun visitConstructor(declaration: IrConstructor) { - constructorSymbolTable.descriptorToSymbol[declaration.descriptor] = declaration.symbol - super.visitConstructor(declaration) - } - - override fun visitEnumEntry(declaration: IrEnumEntry) { - enumEntrySymbolTable.descriptorToSymbol[declaration.descriptor] = declaration.symbol - super.visitEnumEntry(declaration) - } - - override fun visitExternalPackageFragment(declaration: IrExternalPackageFragment) { - externalPackageFragmentTable.descriptorToSymbol[declaration.symbol.descriptor] = declaration.symbol - super.visitExternalPackageFragment(declaration) - } - - override fun visitField(declaration: IrField) { - fieldSymbolTable.descriptorToSymbol[declaration.descriptor] = declaration.symbol - super.visitField(declaration) - } - - override fun visitSimpleFunction(declaration: IrSimpleFunction) { - simpleFunctionSymbolTable.descriptorToSymbol[declaration.descriptor] = declaration.symbol - super.visitSimpleFunction(declaration) - } - - override fun visitTypeParameter(declaration: IrTypeParameter) { - // What about scoped type parameters? - globalTypeParameterSymbolTable.descriptorToSymbol[declaration.descriptor] = declaration.symbol - super.visitTypeParameter(declaration) - } - - override fun visitCall(expression: IrCall) { - expression.symbol.let { - when (it) { - is IrSimpleFunctionSymbol -> simpleFunctionSymbolTable.descriptorToSymbol[it.descriptor] = it - is IrConstructorSymbol -> constructorSymbolTable.descriptorToSymbol[it.descriptor] = it - } - } - - super.visitCall(expression) - } - }) - } } inline fun SymbolTable.withScope(owner: D, block: SymbolTable.(D) -> T): T {