mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
YulOpt: Remove empty cases
This commit is contained in:
committed by
chriseth
parent
be52aa3181
commit
21322dae29
@@ -0,0 +1,19 @@
|
||||
{
|
||||
let y := 200
|
||||
switch add(y, 4)
|
||||
case 0 { }
|
||||
case 1 { }
|
||||
default { }
|
||||
|
||||
switch 4
|
||||
case 0 { }
|
||||
case 1 { }
|
||||
default { }
|
||||
}
|
||||
// ----
|
||||
// structuralSimplifier
|
||||
// {
|
||||
// let y := 200
|
||||
// pop(add(y, 4))
|
||||
// pop(4)
|
||||
// }
|
||||
@@ -8,8 +8,8 @@
|
||||
// structuralSimplifier
|
||||
// {
|
||||
// let y := 200
|
||||
// switch y
|
||||
// case 1 {
|
||||
// if eq(1, y)
|
||||
// {
|
||||
// y := 9
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
// structuralSimplifier
|
||||
// {
|
||||
// let y := 200
|
||||
// switch y
|
||||
// case 1 {
|
||||
// if eq(1, y)
|
||||
// {
|
||||
// y := 9
|
||||
// }
|
||||
// }
|
||||
|
||||
+2
-2
@@ -8,8 +8,8 @@
|
||||
// structuralSimplifier
|
||||
// {
|
||||
// let y := 200
|
||||
// switch y
|
||||
// case 1 {
|
||||
// if eq(1, y)
|
||||
// {
|
||||
// y := 9
|
||||
// }
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user