Open matt-kempster opened 5 years ago
I haven't found 1 to be a problem, but 2 I definitely agree with. I've been using --no-debug --no-node-comments
ever since I added those flags.
First, we should just flip --no-debug --no-node-comments
, and maybe combine them into one flag too. Then, we should work on improving the debug workflow - when a particular node fails, output a comment with a // Failed node
comment and some partial contents, as well as outputting relevant (?!) register values.
For 1, btw, this is just something we should do eventually. It's not a problem almost at all, but eventually if this thing is gonna output viable plug-and-play C code, it should conform to style standards.
I have two unrelated complaints about the current state of output:
Lines in the final C code should be limited to 80 characters wherever possible. Python's
textwrap
library will likely be useful here, although we may have to be intelligent about wrapping things like function calls and assignment statements.There is too much noise in stdout when you just want to decompile one function. All of the registers, node information, etc should be output only when desired (e.g. for debugging) or when an error is detected. Also, node info should probably be output not in DFS-order, but in linear order (with the original MIPS).