This is an archive of the discontinued LLVM Phabricator instance.

AsmPrinter: mark the beginning and the end of a function in verbose mode
ClosedPublic

Authored by thegameg on May 17 2017, 4:39 PM.

Details

Summary

Annotate the output with -- Begin func_name and -- End func_name if verbose mode is enabled.

This is particularly useful when using utils/abtest/abtest.py, which we used to annotate using utils/abtest/mark_aarch64fns.py and utils/abtest/mark_armfns.py, which did not work for internal functions.

  • Fixed some ambiguous tests.
  • Fixed abtest.py to use the new markers.
  • Removed old marking scripts.
  • Add AArch64 test.

Diff Detail

Repository
rL LLVM

Event Timeline

thegameg created this revision.May 17 2017, 4:39 PM
MatzeB edited edge metadata.May 17 2017, 5:02 PM

Nice, but I have some nitpicks:

utils/abtest/abtest.py
14–15 ↗(On Diff #99364)

Different architecures have different characters for comments. You can try out

$ grep "CommentString" lib/Target -r

to get some impression of it. Maybe we better change this script to match any line starting with 1 or 2 arbitrary characters followed by " -- Begin ".

thegameg updated this revision to Diff 99380.May 17 2017, 6:06 PM
thegameg marked an inline comment as done.
  • Rename "Begin" / "End" to "Begin / End function".
  • Remove the function name from the end marker.
  • Fix the tests instead of adding -asm-verbose=false.
  • Make abtest.py look for -- Begin function func_name and -- End function without caring about the comment symbol.
MatzeB accepted this revision.May 18 2017, 10:05 AM

LGTM. Thanks!

Please wait a few more days for comments, and if nothing happens commit.

lib/CodeGen/AsmPrinter/AsmPrinter.cpp
631 ↗(On Diff #99380)

This comment needs to be moved further down now.

test/CodeGen/AArch64/asm-print-comments.ll
3 ↗(On Diff #99380)

Maybe add an extra CHECK: foo: as well? (same for bar)

utils/abtest.py
29–33 ↗(On Diff #99380)

This section can be removed now.

This revision is now accepted and ready to land.May 18 2017, 10:05 AM
thegameg updated this revision to Diff 99454.May 18 2017, 10:10 AM
thegameg marked 3 inline comments as done.

Done, thanks for the review!

This revision was automatically updated to reflect the committed changes.