|
|
|
|
|
by harpocrates
2903 days ago
|
|
FWIW we've spent a lot of time trying to re-engineer the control-flow translation to be heuristic-friendly in c2rust. We've extended and tweaked the Relooper algorithm in hopes of preserving more of the initial control flow. It still isn't great, but it is getting better. Offhand, here are some sizeable additions: * Keep track of some extra information from the C source about what basic blocks were in loops or branch points, then use than information to try to extract back out similar looking Rust * Support translating `switch` to `match`, complete with collapsing some patterns together * Properly handle initialization That said, c2rust can be invoked _without_ relooper enabled if you so wish. In that case, it will simply refuse to translate code with goto's. |
|