File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
cli/src/main/scala/scala/scalanative/cli Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import scopt.OptionParser
4
4
5
5
case class OptimizerConfigOptions (
6
6
maxInlineDepth : Option [Int ] = None ,
7
+ maxCalleeSize : Option [Int ] = None ,
7
8
maxCallerSize : Option [Int ] = None ,
8
9
maxInlineSize : Option [Int ] = None
9
10
)
@@ -27,6 +28,13 @@ object OptimizerConfigOptions {
27
28
.text(
28
29
" Maximal size (number of instructions) of the caller method which can accept inlines."
29
30
)
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
+ )
30
38
parser
31
39
.opt[Int ](" max-inline-size" )
32
40
.optional()
Original file line number Diff line number Diff line change @@ -112,8 +112,9 @@ object ConfigConverter {
112
112
val c0 = OptimizerConfig .empty
113
113
val c1 = options.maxInlineDepth.foldLeft(c0)(_.withMaxInlineDepth(_))
114
114
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
117
118
}
118
119
119
120
private def generateConfig (
You can’t perform that action at this time.
0 commit comments