Skip to content

Commit 3ce25ba

Browse files
committed
Remove unnecessary cmds not only in destructive optimization mode. (#8332)
ac572a18947af3f9adde95ff7d8a0804c833d1d8
1 parent 6f76d9b commit 3ce25ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/kotlin/instrumentation/transformers/AnnotationRemovers.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ import wasm.impCfg.WASM_SDK_FUNC_SUMMARY_START
4949
*/
5050
object AnnotationRemovers {
5151

52-
private fun eraseInDestructiveMode(cmd: TACCmd.Simple) =
52+
/** destructive or not, these go */
53+
private fun removeCommand(cmd: TACCmd.Simple) =
5354
when (cmd) {
5455
is TACCmd.Simple.JumpdestCmd,
5556
is TACCmd.Simple.LogCmd,
@@ -136,7 +137,7 @@ object AnnotationRemovers {
136137
val unknownMetas = mutableSetOf<MetaKey<*>>()
137138
ctp.ltacStream()
138139
.filter { (_, cmd) ->
139-
if (ctp.destructiveOptimizations && eraseInDestructiveMode(cmd)) {
140+
if (removeCommand(cmd)) {
140141
return@filter true
141142
}
142143
if (cmd !is TACCmd.Simple.AnnotationCmd) {

0 commit comments

Comments
 (0)