-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add source markers to @ExplicitGroupsComposable
Also removes inner groups around conditions from explicit group composable functions.
- Loading branch information
Showing
8 changed files
with
127 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
....plugins.kotlin.FunctionBodySkippingTransformTests/testExplicitGroups[useFir = false].txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// Source | ||
// ------------------------------------------ | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.NonRestartableComposable | ||
import androidx.compose.runtime.ReadOnlyComposable | ||
|
||
|
||
import androidx.compose.runtime.* | ||
|
||
@Composable | ||
@ExplicitGroupsComposable | ||
inline fun ReusableContentHost(active: Boolean, crossinline content: @Composable () -> Unit) { | ||
currentComposer.startReusableGroup(200, active) | ||
val activeChanged = currentComposer.changed(active) | ||
if (active) { | ||
content() | ||
} else { | ||
currentComposer.deactivateToEndGroup(activeChanged) | ||
} | ||
currentComposer.endReusableGroup() | ||
} | ||
|
||
// | ||
// Transformed IR | ||
// ------------------------------------------ | ||
|
||
@Composable | ||
@ExplicitGroupsComposable | ||
@ComposableInferredTarget(scheme = "[0[0]]") | ||
fun ReusableContentHost(active: Boolean, crossinline content: Function2<Composer, Int, Unit>, %composer: Composer?, %changed: Int) { | ||
sourceInformationMarkerStart(%composer, <>, "CC(ReusableContentHost)<conten...>:Test.kt") | ||
%composer.startReusableGroup(200, active) | ||
val activeChanged = %composer.changed(active) | ||
if (active) { | ||
content(%composer, 0b1110 and %changed shr 0b0011) | ||
} else { | ||
%composer.deactivateToEndGroup(activeChanged) | ||
} | ||
%composer.endReusableGroup() | ||
sourceInformationMarkerEnd(%composer) | ||
} |
43 changes: 43 additions & 0 deletions
43
...r.plugins.kotlin.FunctionBodySkippingTransformTests/testExplicitGroups[useFir = true].txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// Source | ||
// ------------------------------------------ | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.NonRestartableComposable | ||
import androidx.compose.runtime.ReadOnlyComposable | ||
|
||
|
||
import androidx.compose.runtime.* | ||
|
||
@Composable | ||
@ExplicitGroupsComposable | ||
inline fun ReusableContentHost(active: Boolean, crossinline content: @Composable () -> Unit) { | ||
currentComposer.startReusableGroup(200, active) | ||
val activeChanged = currentComposer.changed(active) | ||
if (active) { | ||
content() | ||
} else { | ||
currentComposer.deactivateToEndGroup(activeChanged) | ||
} | ||
currentComposer.endReusableGroup() | ||
} | ||
|
||
// | ||
// Transformed IR | ||
// ------------------------------------------ | ||
|
||
@Composable | ||
@ExplicitGroupsComposable | ||
@ComposableInferredTarget(scheme = "[0[0]]") | ||
fun ReusableContentHost(active: Boolean, crossinline content: Function2<Composer, Int, Unit>, %composer: Composer?, %changed: Int) { | ||
sourceInformationMarkerStart(%composer, <>, "CC(ReusableContentHost)<conten...>:Test.kt") | ||
%composer.startReusableGroup(200, active) | ||
val activeChanged = %composer.changed(active) | ||
if (active) { | ||
content(%composer, 0b1110 and %changed shr 0b0011) | ||
} else { | ||
%composer.deactivateToEndGroup(activeChanged) | ||
} | ||
%composer.endReusableGroup() | ||
sourceInformationMarkerEnd(%composer) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters