@@ -41,18 +41,18 @@ class InlinerHeuristics[BT <: BTypes](val bTypes: BT) {
4141 compilingMethods.map(methodNode => {
4242 var requests = Set .empty[InlineRequest ]
4343 callGraph.callsites(methodNode).valuesIterator foreach {
44- case callsite @ Callsite (_, _, _, Right (Callee (callee, calleeDeclClass, safeToInline, _, annotatedInline , _, _, callsiteWarning)), _, _, _, pos) =>
44+ case callsite @ Callsite (_, _, _, Right (Callee (callee, calleeDeclClass, safeToInline, _, calleeAnnotatedInline , _, _, callsiteWarning)), _, _, _, pos, _, _ ) =>
4545 inlineRequest(callsite) match {
4646 case Some (Right (req)) => requests += req
4747 case Some (Left (w)) =>
48- if ((annotatedInline && bTypes.compilerSettings.YoptWarningEmitAtInlineFailed ) || w.emitWarning(compilerSettings)) {
49- val annotWarn = if (annotatedInline ) " is annotated @inline but" else " "
48+ if ((calleeAnnotatedInline && bTypes.compilerSettings.YoptWarningEmitAtInlineFailed ) || w.emitWarning(compilerSettings)) {
49+ val annotWarn = if (calleeAnnotatedInline ) " is annotated @inline but" else " "
5050 val msg = s " ${BackendReporting .methodSignature(calleeDeclClass.internalName, callee)}$annotWarn could not be inlined: \n $w"
5151 backendReporting.inlinerWarning(callsite.callsitePosition, msg)
5252 }
5353
5454 case None =>
55- if (annotatedInline && bTypes.compilerSettings.YoptWarningEmitAtInlineFailed ) {
55+ if (calleeAnnotatedInline && ! callsite.annotatedNoInline && bTypes.compilerSettings.YoptWarningEmitAtInlineFailed ) {
5656 // if the callsite is annotated @inline, we report an inline warning even if the underlying
5757 // reason is, for example, mixed compilation (which has a separate -Yopt-warning flag).
5858 def initMsg = s " ${BackendReporting .methodSignature(calleeDeclClass.internalName, callee)} is annotated @inline but cannot be inlined "
@@ -69,7 +69,7 @@ class InlinerHeuristics[BT <: BTypes](val bTypes: BT) {
6969 }
7070 }
7171
72- case Callsite (ins, _, _, Left (warning), _, _, _, pos) =>
72+ case Callsite (ins, _, _, Left (warning), _, _, _, pos, _, _ ) =>
7373 if (warning.emitWarning(compilerSettings))
7474 backendReporting.inlinerWarning(pos, s " failed to determine if ${ins.name} should be inlined: \n $warning" )
7575 }
@@ -108,12 +108,11 @@ class InlinerHeuristics[BT <: BTypes](val bTypes: BT) {
108108 else None
109109
110110 case " default" =>
111- if (callee.safeToInline && ! callee.annotatedNoInline) {
112- val shouldInlineHO = callee.samParamTypes.nonEmpty && (callee.samParamTypes exists {
111+ if (callee.safeToInline && ! callee.annotatedNoInline && ! callsite.annotatedNoInline ) {
112+ def shouldInlineHO = callee.samParamTypes.nonEmpty && (callee.samParamTypes exists {
113113 case (index, _) => callsite.argInfos.contains(index)
114114 })
115-
116- if (shouldInlineHO || callee.annotatedInline) Some (requestIfCanInline(callsite))
115+ if (callee.annotatedInline || callsite.annotatedInline || shouldInlineHO) Some (requestIfCanInline(callsite))
117116 else None
118117 } else None
119118 }
0 commit comments