Commit 1bdf1e0
committed
Improve error handling: replace assert false with ICE and fix SList dead code elimination
Two improvements to internal error handling and optimization consistency:
1. Replace bare `assert false` in Info.ml with a proper
ICE.internal_compiler_error call that includes the offending type in
the error message. This produces a helpful diagnostic with a link to
the issue tracker instead of a generic assertion failure if
this unreachable branch is ever hit.
2. Fix inconsistent SList handling in dead_code_elim: Block and Profile
both collapse to Skip when all children are eliminated, but SList
was left as an empty SList []. This is inconsistent and produces
unnecessary nodes that Mir_utils.cleanup_stmts already treats as
equivalent to Skip (line 435).1 parent 0121e19 commit 1bdf1e0
2 files changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
805 | 805 | | |
806 | 806 | | |
807 | 807 | | |
808 | | - | |
| 808 | + | |
809 | 809 | | |
810 | 810 | | |
811 | 811 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
0 commit comments