gccrs
gccrs copied to clipboard
HIR Dump
Our HIR dump looks like this currently:
BlockExpr:
{
outer attributes: none
inner attributes: none
statements:
ExprStmtWithoutBlock:
MethodCallExpr:
Object (receiver) expr: ( t ([C: 0 Nid: 97 Hid: 77]))
Method path segment:
baz
Call params:none
final expression: none
}::[C: 0 Nid: 102 Hid: 81 Lid: 26]
Which is very messy and is a clone of our AST as_string methods which is fine for gdb sessions but bad for textural output.
- [ ] Converge on an S-expression format, which is more extensible and easier to read
- [x] Add command line switch https://github.com/Rust-GCC/gccrs/pull/222
- [x] Add dump entry point https://github.com/Rust-GCC/gccrs/blob/28f527c9598339cf834a30b5ee1f14258b8ecbb2/gcc/rust/rust-session-manager.cc#L874-L888
- [x] Dump to file
- [ ] Print block statements
- [ ] Print block tail expression if present
- [ ] Print crate mapping attributes
- [ ] Print function parameters
- [ ] Visit function's definition block
@YizhePKU ping ? I guess I'll base my work over your previous prototype. Maybe you also want to work on this ? If you don't, it's fine, just wanted to ask first before doing anything :)
That's very nice of you. I don't have plans to return to this project anytime soon, so go ahead :)
FTR, the proof-of-concept by @YizhePKU https://github.com/Rust-GCC/gccrs/pull/318