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
44
55case 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()
Original file line number Diff line number Diff 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 (
You can’t perform that action at this time.
0 commit comments