immunant / c2rust

Migrate C code to Rust
https://c2rust.com/
Other
3.95k stars 234 forks source link

analyze: refactor struct and static rewrites #1005

Closed spernsteiner closed 1 year ago

spernsteiner commented 1 year ago

This branch refactors rewrite generation for structs and statics to make it easier for main.rs to control exactly which items get rewritten. This is in preparation for adding a filtering option that can disable rewriting for any DefId. In particular, rewriting of structs and fields has been separated from rewriting of function signatures, and static rewriting has been broken up, so that all rewrite::gen_*_rewrites functions work on a single item per call rather than internally iterating over all relevant items.