You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When writing code for compiler backends, we sometimes
need to manual create assembly instructions by initializing cmd/internal/obj.Prog structs directly. Even though
the revamped Addr types makes the task much easier than
it was, the process is still very error-prone and any mistakes
made there is pretty hard to diagnose.
I propose that we add an internal mode to cmd/asm that
instead of dumping .o object file, it prints the required
Prog initialization code to stdout.
I first discussed this with @cherrymui and we both liked the
idea.
Ideally, the new mode should be able to accept instruction
either from stdin, or better, from command line, so it is easier
to use from within an editor. This mode might also serve as
documentation for mapping instructions to Prog.
bradfitz
changed the title
proposal: cmd/asm: a flag to dump Prog initialization as Go code
cmd/asm: a flag to dump Prog initialization as Go code
Aug 29, 2016
When writing code for compiler backends, we sometimes
need to manual create assembly instructions by initializing
cmd/internal/obj.Prog
structs directly. Even thoughthe revamped
Addr
types makes the task much easier thanit was, the process is still very error-prone and any mistakes
made there is pretty hard to diagnose.
I propose that we add an internal mode to cmd/asm that
instead of dumping .o object file, it prints the required
Prog initialization code to stdout.
I first discussed this with @cherrymui and we both liked the
idea.
Ideally, the new mode should be able to accept instruction
either from stdin, or better, from command line, so it is easier
to use from within an editor. This mode might also serve as
documentation for mapping instructions to Prog.
/cc @robpike @randall77 @ianlancetaylor
The text was updated successfully, but these errors were encountered: