mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
1. add basic block index for each basicblock, so there should no basic block display empty string 2. use `shape` box, since it is basic **block** ## Before  ## After 
223 lines
4.5 KiB
Text
223 lines
4.5 KiB
Text
---
|
|
source: crates/oxc_semantic/tests/integration/cfg.rs
|
|
expression: snapshot
|
|
input_file: crates/oxc_semantic/tests/integration/cfg_fixtures/switch_statement.js
|
|
---
|
|
bb0: {
|
|
|
|
}
|
|
|
|
bb1: {
|
|
|
|
}
|
|
|
|
bb2: {
|
|
|
|
}
|
|
|
|
bb3: {
|
|
statement
|
|
}
|
|
|
|
bb4: {
|
|
condition
|
|
}
|
|
|
|
bb5: {
|
|
statement
|
|
break
|
|
}
|
|
|
|
bb6: {
|
|
unreachable
|
|
}
|
|
|
|
bb7: {
|
|
condition
|
|
}
|
|
|
|
bb8: {
|
|
statement
|
|
}
|
|
|
|
bb9: {
|
|
condition
|
|
}
|
|
|
|
bb10: {
|
|
statement
|
|
break
|
|
}
|
|
|
|
bb11: {
|
|
unreachable
|
|
}
|
|
|
|
bb12: {
|
|
condition
|
|
}
|
|
|
|
bb13: {
|
|
statement
|
|
statement
|
|
statement
|
|
statement
|
|
return <value>
|
|
}
|
|
|
|
bb14: {
|
|
unreachable
|
|
}
|
|
|
|
bb15: {
|
|
condition
|
|
}
|
|
|
|
bb16: {
|
|
statement
|
|
statement
|
|
statement
|
|
}
|
|
|
|
bb17: {
|
|
|
|
}
|
|
|
|
bb18: {
|
|
statement
|
|
return <value>
|
|
}
|
|
|
|
bb19: {
|
|
unreachable
|
|
}
|
|
|
|
bb20: {
|
|
statement
|
|
return <value>
|
|
}
|
|
|
|
bb21: {
|
|
unreachable
|
|
}
|
|
|
|
bb22: {
|
|
|
|
}
|
|
|
|
digraph {
|
|
0 [ label = "bb0" shape = box]
|
|
1 [ label = "bb1" shape = box]
|
|
2 [ label = "bb2" shape = box]
|
|
3 [ label = "bb3
|
|
SwitchStatement" shape = box]
|
|
4 [ label = "bb4
|
|
Condition(1)" shape = box]
|
|
5 [ label = "bb5
|
|
ExpressionStatement
|
|
break" shape = box]
|
|
6 [ label = "bb6
|
|
unreachable" shape = box]
|
|
7 [ label = "bb7
|
|
Condition(2)" shape = box]
|
|
8 [ label = "bb8
|
|
ExpressionStatement" shape = box]
|
|
9 [ label = "bb9
|
|
Condition(3)" shape = box]
|
|
10 [ label = "bb10
|
|
ExpressionStatement
|
|
break" shape = box]
|
|
11 [ label = "bb11
|
|
unreachable" shape = box]
|
|
12 [ label = "bb12
|
|
Condition(4)" shape = box]
|
|
13 [ label = "bb13
|
|
BlockStatement
|
|
ExpressionStatement
|
|
VariableDeclaration
|
|
ExpressionStatement
|
|
return <value>" shape = box]
|
|
14 [ label = "bb14
|
|
unreachable" shape = box]
|
|
15 [ label = "bb15
|
|
Condition(5)" shape = box]
|
|
16 [ label = "bb16
|
|
ExpressionStatement
|
|
ExpressionStatement
|
|
ExpressionStatement" shape = box]
|
|
17 [ label = "bb17" shape = box]
|
|
18 [ label = "bb18
|
|
ExpressionStatement
|
|
return <value>" shape = box]
|
|
19 [ label = "bb19
|
|
unreachable" shape = box]
|
|
20 [ label = "bb20
|
|
ExpressionStatement
|
|
return <value>" shape = box]
|
|
21 [ label = "bb21
|
|
unreachable" shape = box]
|
|
22 [ label = "bb22" shape = box]
|
|
1 -> 0 [ label = "Error(Implicit)" ]
|
|
3 -> 2 [ label = "Error(Implicit)" ]
|
|
1 -> 3 [ label = "NewFunction" ]
|
|
4 -> 2 [ label = "Error(Implicit)" ]
|
|
5 -> 2 [ label = "Error(Implicit)" ]
|
|
4 -> 5 [ label = "Jump" ]
|
|
6 -> 2 [ label = "Error(Implicit)" , style = "dotted" ]
|
|
5 -> 6 [ label = "Unreachable" , style = "dotted" ]
|
|
7 -> 2 [ label = "Error(Implicit)" ]
|
|
8 -> 2 [ label = "Error(Implicit)" ]
|
|
7 -> 8 [ label = "Jump" ]
|
|
9 -> 2 [ label = "Error(Implicit)" ]
|
|
10 -> 2 [ label = "Error(Implicit)" ]
|
|
9 -> 10 [ label = "Jump" ]
|
|
11 -> 2 [ label = "Error(Implicit)" , style = "dotted" ]
|
|
10 -> 11 [ label = "Unreachable" , style = "dotted" ]
|
|
12 -> 2 [ label = "Error(Implicit)" ]
|
|
13 -> 2 [ label = "Error(Implicit)" ]
|
|
12 -> 13 [ label = "Jump" ]
|
|
14 -> 2 [ label = "Error(Implicit)" , style = "dotted" ]
|
|
13 -> 14 [ label = "Unreachable" , style = "dotted" ]
|
|
15 -> 2 [ label = "Error(Implicit)" ]
|
|
16 -> 2 [ label = "Error(Implicit)" ]
|
|
15 -> 16 [ label = "Jump" ]
|
|
17 -> 2 [ label = "Error(Implicit)" ]
|
|
18 -> 2 [ label = "Error(Implicit)" ]
|
|
17 -> 18 [ label = "Jump" ]
|
|
19 -> 2 [ label = "Error(Implicit)" , style = "dotted" ]
|
|
18 -> 19 [ label = "Unreachable" , style = "dotted" ]
|
|
4 -> 7 [ label = "Normal" ]
|
|
4 -> 9 [ label = "Normal" ]
|
|
4 -> 12 [ label = "Normal" ]
|
|
4 -> 15 [ label = "Normal" ]
|
|
4 -> 17 [ label = "Normal" ]
|
|
6 -> 7 [ label = "Normal" , style = "dotted" ]
|
|
3 -> 4 [ label = "Normal" ]
|
|
7 -> 9 [ label = "Normal" ]
|
|
7 -> 12 [ label = "Normal" ]
|
|
7 -> 15 [ label = "Normal" ]
|
|
7 -> 17 [ label = "Normal" ]
|
|
8 -> 9 [ label = "Normal" ]
|
|
3 -> 7 [ label = "Normal" ]
|
|
9 -> 12 [ label = "Normal" ]
|
|
9 -> 15 [ label = "Normal" ]
|
|
9 -> 17 [ label = "Normal" ]
|
|
11 -> 12 [ label = "Normal" , style = "dotted" ]
|
|
3 -> 9 [ label = "Normal" ]
|
|
12 -> 15 [ label = "Normal" ]
|
|
12 -> 17 [ label = "Normal" ]
|
|
14 -> 15 [ label = "Normal" , style = "dotted" ]
|
|
3 -> 12 [ label = "Normal" ]
|
|
15 -> 17 [ label = "Normal" ]
|
|
16 -> 17 [ label = "Normal" ]
|
|
3 -> 15 [ label = "Normal" ]
|
|
3 -> 17 [ label = "Normal" ]
|
|
20 -> 2 [ label = "Error(Implicit)" ]
|
|
19 -> 20 [ label = "Normal" , style = "dotted" ]
|
|
5 -> 20 [ label = "Jump" ]
|
|
10 -> 20 [ label = "Jump" ]
|
|
21 -> 2 [ label = "Error(Implicit)" , style = "dotted" ]
|
|
20 -> 21 [ label = "Unreachable" , style = "dotted" ]
|
|
22 -> 0 [ label = "Error(Implicit)" ]
|
|
1 -> 22 [ label = "Normal" ]
|
|
}
|