[IR] Extract descriptor part from SymbolTable into separate component
After this change SymbolTable (and ReferenceSymbolTable) contains only methods with IdSignatures. All descriptors-related methods are moved into DescriptorSymbolTableExtension, which automatically delegates to the SymbolTable if needed At this moment there are cross-references between SymbolTable, because descriptor API is still actively used across backends. So SymbolTable is accessible in some place then descriptor extension will be accessible too DescriptorSymbolTableExtension is an implementation of abstract SymbolTableExtension which allows to implement different kinds of storages, e.g. FIR based (it probably will be needed for FIR2IR)
This commit is contained in:
committed by
Space Team
parent
0067eb85da
commit
4986cb14aa
+3
-2
@@ -7,12 +7,12 @@ package org.jetbrains.kotlin.test.backend.handlers
|
||||
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.declarations.IrExternalPackageFragment
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
|
||||
import org.jetbrains.kotlin.ir.declarations.lazy.AbstractIrLazyFunction
|
||||
import org.jetbrains.kotlin.ir.expressions.IrMemberAccessExpression
|
||||
import org.jetbrains.kotlin.ir.util.DeserializableClass
|
||||
import org.jetbrains.kotlin.ir.util.IdSignature
|
||||
import org.jetbrains.kotlin.ir.util.allUnbound
|
||||
import org.jetbrains.kotlin.ir.util.resolveFakeOverride
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid
|
||||
import org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid
|
||||
@@ -24,13 +24,14 @@ import org.jetbrains.kotlin.test.services.TestServices
|
||||
class IrInlineBodiesHandler(testServices: TestServices) : AbstractIrHandler(testServices) {
|
||||
val declaredInlineFunctionSignatures = mutableSetOf<IdSignature>()
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
override fun processModule(module: TestModule, info: IrBackendInput) {
|
||||
info.processAllIrModuleFragments(module) { irModule, _ ->
|
||||
irModule.acceptChildrenVoid(InlineFunctionsCollector())
|
||||
irModule.acceptChildrenVoid(InlineCallBodiesCheck(firEnabled = module.frontendKind == FrontendKinds.FIR))
|
||||
}
|
||||
|
||||
assertions.assertTrue((info as IrBackendInput.JvmIrBackendInput).backendInput.symbolTable.allUnbound.isEmpty())
|
||||
assertions.assertTrue((info as IrBackendInput.JvmIrBackendInput).backendInput.symbolTable.descriptorExtension.allUnboundSymbols.isEmpty())
|
||||
}
|
||||
|
||||
override fun processAfterAllModules(someAssertionWasFailed: Boolean) {
|
||||
|
||||
Reference in New Issue
Block a user