Skip to content

Commit

Permalink
[IR] Replace NO_DOUBLE_INLINING with unconditional false
Browse files Browse the repository at this point in the history
#KT-70451
  • Loading branch information
ivandev0 authored and qodana-bot committed Jan 22, 2025
1 parent f0f7956 commit d8cc833
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class OuterThisInInlineFunctionsSpecialAccessorLowering(context: LoweringContext
* - To work around this we shall generate public "outer this" accessors if [SyntheticAccessorLowering]
* is not enabled.
*/
private val generatePublicAccessors: Boolean = context.configuration.getBoolean(KlibConfigurationKeys.NO_DOUBLE_INLINING)
private val generatePublicAccessors: Boolean = false

private val accessorGenerator = KlibSyntheticAccessorGenerator(context)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -761,20 +761,20 @@ fun getJsLowerings(
sharedVariablesLoweringPhase,
outerThisSpecialAccessorInInlineFunctionsPhase,
localClassesInInlineLambdasPhase,
localClassesInInlineFunctionsPhase.takeIf { configuration.getBoolean(KlibConfigurationKeys.NO_DOUBLE_INLINING) },
localClassesExtractionFromInlineFunctionsPhase.takeIf { configuration.getBoolean(KlibConfigurationKeys.NO_DOUBLE_INLINING) },
localClassesInInlineFunctionsPhase.takeIf { false },
localClassesExtractionFromInlineFunctionsPhase.takeIf { false },
inlineCallableReferenceToLambdaPhase,
arrayConstructorPhase,
legacySyntheticAccessorLoweringPhase.takeIf { configuration.getBoolean(KlibConfigurationKeys.NO_DOUBLE_INLINING) },
legacySyntheticAccessorLoweringPhase.takeIf { false },
wrapInlineDeclarationsWithReifiedTypeParametersLowering,
inlineOnlyPrivateFunctionsPhase.takeUnless { configuration.getBoolean(KlibConfigurationKeys.NO_DOUBLE_INLINING) },
syntheticAccessorGenerationPhase.takeUnless { configuration.getBoolean(KlibConfigurationKeys.NO_DOUBLE_INLINING) },
inlineOnlyPrivateFunctionsPhase.takeUnless { false },
syntheticAccessorGenerationPhase.takeUnless { false },
// Note: The validation goes after both `inlineOnlyPrivateFunctionsPhase` and `syntheticAccessorGenerationPhase`
// just because it goes so in Native.
validateIrAfterInliningOnlyPrivateFunctions.takeUnless { configuration.getBoolean(KlibConfigurationKeys.NO_DOUBLE_INLINING) },
validateIrAfterInliningOnlyPrivateFunctions.takeUnless { false },
inlineAllFunctionsPhase,
dumpSyntheticAccessorsPhase.takeIf {
!configuration.getBoolean(KlibConfigurationKeys.NO_DOUBLE_INLINING) &&
!false &&
configuration[KlibConfigurationKeys.SYNTHETIC_ACCESSORS_DUMP_DIR] != null
},
validateIrAfterInliningAllFunctions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private val outerThisSpecialAccessorInInlineFunctionsPhase = createFileLoweringP
private val extractLocalClassesFromInlineBodies = createFileLoweringPhase(
{ context, irFile ->
LocalClassesInInlineLambdasLowering(context).lower(irFile)
if (!context.config.produce.isCache && context.config.configuration.getBoolean(KlibConfigurationKeys.NO_DOUBLE_INLINING)) {
if (!context.config.produce.isCache && false) {
LocalClassesInInlineFunctionsLowering(context).lower(irFile)
LocalClassesExtractionFromInlineFunctionsLowering(context).lower(irFile)
}
Expand Down Expand Up @@ -561,8 +561,8 @@ internal fun KonanConfig.getLoweringsUpToAndIncludingSyntheticAccessors(): Lower
outerThisSpecialAccessorInInlineFunctionsPhase,
extractLocalClassesFromInlineBodies,
arrayConstructorPhase,
inlineOnlyPrivateFunctionsPhase.takeUnless { this.configuration.getBoolean(KlibConfigurationKeys.NO_DOUBLE_INLINING) },
syntheticAccessorGenerationPhase.takeUnless { this.configuration.getBoolean(KlibConfigurationKeys.NO_DOUBLE_INLINING) },
inlineOnlyPrivateFunctionsPhase.takeUnless { false },
syntheticAccessorGenerationPhase.takeUnless { false },
)

internal fun KonanConfig.getLoweringsAfterInlining(): LoweringList = listOfNotNull(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ internal fun <C : PhaseContext> PhaseEngine<C>.runBackend(backendContext: Contex
// To avoid overcomplicating things and to keep running the preceding lowerings with "modify-only-lowered-file"
// invariant, we would like to put a synchronization point immediately before "InlineAllFunctions".
fragmentWithState.forEach { (fragment, state) -> state.runSpecifiedLowerings(fragment, state.context.config.getLoweringsUpToAndIncludingSyntheticAccessors()) }
if (!context.config.configuration.getBoolean(KlibConfigurationKeys.NO_DOUBLE_INLINING)) {
if (!false) {
fragmentWithState.forEach { (fragment, state) -> state.runSpecifiedLowerings(fragment, validateIrAfterInliningOnlyPrivateFunctions) }
}
fragmentWithState.forEach { (fragment, state) -> state.runSpecifiedLowerings(fragment, listOf(inlineAllFunctionsPhase)) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ internal class NativeInlineFunctionResolver(
private fun lower(function: IrFunction) {
val body = function.body ?: return

val doubleInliningEnabled = !context.config.configuration.getBoolean(KlibConfigurationKeys.NO_DOUBLE_INLINING)
val doubleInliningEnabled = !false

UpgradeCallableReferences(context).lower(function)

Expand Down

0 comments on commit d8cc833

Please sign in to comment.