mmcloughlin / avo

Generate x86 Assembly with Go
BSD 3-Clause "New" or "Revised" License
2.73k stars 89 forks source link

printer: ensure compatibility with asmfmt #8

Open mmcloughlin opened 5 years ago

mmcloughlin commented 5 years ago

klauspost/asmfmt is the de facto standard for Go assembly formatting. It would be good to produce output that conforms to asmfmt.

I have a preference for avoiding non-Go dependencies (stdlib and sub-repos only). Therefore:

Either way, it would be good to have a check in CI to confirm that all generated files are formatted correctly. Something like find . -name '*.s' | xargs asmfmt -w and check the git repo is clean.

mmcloughlin commented 5 years ago

Fixed by 27cea3be8be210e33c6dbb00b0f9dff7d3bb46ae

mmcloughlin commented 5 years ago

Based on 3ca82be16cb95edc5d7c89ecc426c7eb0e233ba8 I think we have a mismatch with comments ahead of labels. But there seems to be a special case when there is a comment above and below a label? Needs investigation.

mmcloughlin commented 5 years ago

I think asmfmt sets indentation to 0 after terminal instructions. I'm not quite sure this is correct behavior. Filed klauspost/asmfmt#35 to discuss.