Skip to content

Commit 654d085

Browse files
committed
Adapt to optimizer config changes
1 parent 49a862c commit 654d085

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

cli/src/main/scala/scala/scalanative/cli/options/OptimizerConfigOptions.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import scopt.OptionParser
44

55
case class OptimizerConfigOptions(
66
maxInlineDepth: Option[Int] = None,
7+
maxCalleeSize: Option[Int] = None,
78
maxCallerSize: Option[Int] = None,
89
maxInlineSize: Option[Int] = None
910
)
@@ -27,6 +28,13 @@ object OptimizerConfigOptions {
2728
.text(
2829
"Maximal size (number of instructions) of the caller method which can accept inlines."
2930
)
31+
parser
32+
.opt[Int]("max-callee-size")
33+
.optional()
34+
.action((x, c) => update(c)(_.copy(maxCalleeSize = Some(x))))
35+
.text(
36+
"Maximal size (number of instructions) of the method to be inlined."
37+
)
3038
parser
3139
.opt[Int]("max-inline-size")
3240
.optional()

cli/src/main/scala/scala/scalanative/cli/utils/ConfigConverter.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@ object ConfigConverter {
112112
val c0 = OptimizerConfig.empty
113113
val c1 = options.maxInlineDepth.foldLeft(c0)(_.withMaxInlineDepth(_))
114114
val c2 = options.maxCallerSize.foldLeft(c1)(_.withMaxCallerSize(_))
115-
val c3 = options.maxInlineSize.foldLeft(c2)(_.withMaxInlineSize(_))
116-
c3
115+
val c3 = options.maxCalleeSize.foldLeft(c2)(_.withMaxCalleeSize(_))
116+
val c4 = options.maxInlineSize.foldLeft(c3)(_.withSmallFunctionSize(_))
117+
c4
117118
}
118119

119120
private def generateConfig(

0 commit comments

Comments
 (0)