-
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.
Ensure that inline body is realized when source information is off
aosp/3032485 realized groups inside inline functions only when source information is enabled, which is incorrect. Test: compiler tests Fixes: 338179884 ( https://issuetracker.google.com/issues/338179884 ) Change-Id: Idddb882db6bf455032b12cf8a5a0d7d2bac85568 ( https://android-review.googlesource.com/q/Idddb882db6bf455032b12cf8a5a0d7d2bac85568 ) Moved from: androidx/androidx@428fff5
- Loading branch information
Showing
4 changed files
with
115 additions
and
6 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
...ngTransformTestsNoSource/testInlineCallInsideComposableInlineFunction[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.* | ||
import androidx.compose.foundation.layout.* | ||
|
||
@Composable | ||
fun Test(count: Int) { | ||
Row { | ||
repeat(count) { | ||
Text("A") | ||
} | ||
} | ||
} | ||
|
||
// | ||
// Transformed IR | ||
// ------------------------------------------ | ||
|
||
@Composable | ||
@ComposableTarget(applier = "androidx.compose.ui.UiComposable") | ||
fun Test(count: Int, %composer: Composer?, %changed: Int) { | ||
%composer = %composer.startRestartGroup(<>) | ||
val %dirty = %changed | ||
if (%changed and 0b1110 == 0) { | ||
%dirty = %dirty or if (%composer.changed(count)) 0b0100 else 0b0010 | ||
} | ||
if (%dirty and 0b1011 != 0b0010 || !%composer.skipping) { | ||
Row(null, null, null, { %composer: Composer?, %changed: Int -> | ||
%composer.startReplaceGroup(<>) | ||
repeat(count) { it: Int -> | ||
Text("A", %composer, 0b0110) | ||
} | ||
%composer.endReplaceGroup() | ||
}, %composer, 0, 0b0111) | ||
} else { | ||
%composer.skipToGroupEnd() | ||
} | ||
%composer.endRestartGroup()?.updateScope { %composer: Composer?, %force: Int -> | ||
Test(count, %composer, updateChangedFlags(%changed or 0b0001)) | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...ingTransformTestsNoSource/testInlineCallInsideComposableInlineFunction[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.* | ||
import androidx.compose.foundation.layout.* | ||
|
||
@Composable | ||
fun Test(count: Int) { | ||
Row { | ||
repeat(count) { | ||
Text("A") | ||
} | ||
} | ||
} | ||
|
||
// | ||
// Transformed IR | ||
// ------------------------------------------ | ||
|
||
@Composable | ||
@ComposableTarget(applier = "androidx.compose.ui.UiComposable") | ||
fun Test(count: Int, %composer: Composer?, %changed: Int) { | ||
%composer = %composer.startRestartGroup(<>) | ||
val %dirty = %changed | ||
if (%changed and 0b1110 == 0) { | ||
%dirty = %dirty or if (%composer.changed(count)) 0b0100 else 0b0010 | ||
} | ||
if (%dirty and 0b1011 != 0b0010 || !%composer.skipping) { | ||
Row(null, null, null, { %composer: Composer?, %changed: Int -> | ||
%composer.startReplaceGroup(<>) | ||
repeat(count) { it: Int -> | ||
Text("A", %composer, 0b0110) | ||
} | ||
%composer.endReplaceGroup() | ||
}, %composer, 0, 0b0111) | ||
} else { | ||
%composer.skipToGroupEnd() | ||
} | ||
%composer.endRestartGroup()?.updateScope { %composer: Composer?, %force: Int -> | ||
Test(count, %composer, updateChangedFlags(%changed or 0b0001)) | ||
} | ||
} |
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