Skip to content

Commit a0c0278

Browse files
authored
Merge pull request #5103 from sjrd/remove-dead-code-in-optimizercore
Remove dead code in OptimizerCore.
2 parents 8782649 + 67fac71 commit a0c0278

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

linker/shared/src/main/scala/org/scalajs/linker/frontend/optimizer/OptimizerCore.scala

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ private[optimizer] abstract class OptimizerCore(
384384
* `Return`s we produce in order to decide whether we can remove
385385
* the `Labeled`.
386386
*/
387-
info.returnedTreeTypes.value ::= RefinedType.NoRefinedType
387+
info.returnedTreeTypes.value ::= RefinedType(VoidType)
388388
Return(newExpr, newLabel)
389389
}
390390
} else if (!info.acceptRecords) {
@@ -5725,8 +5725,6 @@ private[optimizer] object OptimizerCore {
57255725
private final class TooManyRollbacksException
57265726
extends scala.util.control.ControlThrowable
57275727

5728-
private val AnonFunctionClassPrefix = "sjsr_AnonFunction"
5729-
57305728
private type CancelFun = () => Nothing
57315729
private type PreTransCont = PreTransform => TailRec[Tree]
57325730

@@ -5736,12 +5734,6 @@ private[optimizer] object OptimizerCore {
57365734
def isNullable: Boolean = base.isNullable
57375735

57385736
def isNothingType: Boolean = base == NothingType
5739-
5740-
def toNonNullable: RefinedType = {
5741-
if (!isNullable) this
5742-
else if (base == NullType) RefinedType.Nothing
5743-
else RefinedType(base.toNonNullable, isExact, allocationSite)
5744-
}
57455737
}
57465738

57475739
private object RefinedType {
@@ -5766,9 +5758,6 @@ private[optimizer] object OptimizerCore {
57665758
}
57675759
RefinedType(tpe, isExact)
57685760
}
5769-
5770-
val NoRefinedType = RefinedType(VoidType)
5771-
val Nothing = RefinedType(NothingType)
57725761
}
57735762

57745763
/**
@@ -6018,12 +6007,6 @@ private[optimizer] object OptimizerCore {
60186007
copy(implsBeingInlined = implsBeingInlined + impl)
60196008
}
60206009

6021-
def inlining(impls: Set[Scope.InliningID]): Scope = {
6022-
val intersection = implsBeingInlined.intersect(impls)
6023-
assert(intersection.isEmpty, s"Circular inlining of $intersection")
6024-
copy(implsBeingInlined = implsBeingInlined ++ impls)
6025-
}
6026-
60276010
def withImportReplacement(importReplacement: ImportReplacement): Scope = {
60286011
assert(this.importReplacement.isEmpty, "Alreadying replacing " +
60296012
s"$this.importReplacement while trying to replace $importReplacement")
@@ -6418,10 +6401,6 @@ private[optimizer] object OptimizerCore {
64186401
if (y >= 0) x-y <= x
64196402
else x-y > x
64206403

6421-
/** Tests whether `-x` is valid without falling out of range. */
6422-
private def canNegateLong(x: Long): Boolean =
6423-
x != Long.MinValue
6424-
64256404
private final class Intrinsics(intrinsicsMap: Map[(ClassName, MethodName), Int]) {
64266405
def apply(flags: ApplyFlags, target: AbstractMethodID): Int = {
64276406
if (flags.isPrivate || flags.isConstructor) {

0 commit comments

Comments
 (0)