[JS IR BE] remove unnecesary code from DCE
This commit is contained in:
@@ -205,9 +205,6 @@ fun usefulDeclarations(roots: Iterable<IrDeclaration>, context: JsIrBackendConte
|
|||||||
while (queue.isNotEmpty()) {
|
while (queue.isNotEmpty()) {
|
||||||
val declaration = queue.pollFirst()
|
val declaration = queue.pollFirst()
|
||||||
|
|
||||||
// TODO remove?
|
|
||||||
stageController.lazyLower(declaration)
|
|
||||||
|
|
||||||
fun IrDeclaration.enqueue(description: String, isContagious: Boolean = true) {
|
fun IrDeclaration.enqueue(description: String, isContagious: Boolean = true) {
|
||||||
enqueue(declaration, description, isContagious)
|
enqueue(declaration, description, isContagious)
|
||||||
}
|
}
|
||||||
@@ -217,15 +214,6 @@ fun usefulDeclarations(roots: Iterable<IrDeclaration>, context: JsIrBackendConte
|
|||||||
(it.classifierOrNull as? IrClassSymbol)?.owner?.enqueue("superTypes")
|
(it.classifierOrNull as? IrClassSymbol)?.owner?.enqueue("superTypes")
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO find out how `doResume` gets removed
|
|
||||||
if (declaration.symbol == context.ir.symbols.coroutineImpl) {
|
|
||||||
declaration.declarations.toList().forEach {
|
|
||||||
if (it is IrSimpleFunction && it.name.asString() == "doResume") {
|
|
||||||
it.enqueue("hack for CoroutineImpl::doResume")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
declaration.annotations.forEach {
|
declaration.annotations.forEach {
|
||||||
val annotationClass = it.symbol.owner.constructedClass
|
val annotationClass = it.symbol.owner.constructedClass
|
||||||
if (annotationClass.isAssociatedObjectAnnotatedAnnotation) {
|
if (annotationClass.isAssociatedObjectAnnotatedAnnotation) {
|
||||||
@@ -254,9 +242,6 @@ fun usefulDeclarations(roots: Iterable<IrDeclaration>, context: JsIrBackendConte
|
|||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO remove?
|
|
||||||
(body as? IrBody)?.let { stageController.lazyLower(it) }
|
|
||||||
|
|
||||||
body?.acceptVoid(object : IrElementVisitorVoid {
|
body?.acceptVoid(object : IrElementVisitorVoid {
|
||||||
override fun visitElement(element: IrElement) {
|
override fun visitElement(element: IrElement) {
|
||||||
element.acceptChildrenVoid(this)
|
element.acceptChildrenVoid(this)
|
||||||
|
|||||||
Reference in New Issue
Block a user