This is an archive of the discontinued LLVM Phabricator instance.

Use `-cfg-func-name` value as filter for `-view-cfg`, etc.
ClosedPublic

Authored by fodinabor on May 6 2021, 11:19 AM.

Details

Summary

Currently the value is only used when calling F->viewCFG() which is missing out on its potential and usefulness.
So I added the check to the printer passes as well.

Diff Detail

Event Timeline

fodinabor created this revision.May 6 2021, 11:19 AM
fodinabor requested review of this revision.May 6 2021, 11:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 6 2021, 11:19 AM
fodinabor updated this revision to Diff 343713.May 7 2021, 10:25 AM

Add test for the filtering with -dot-cfg and -dot-cfg-only. As far as I see it, the view variant is not really testable. Happy to be proved wrong, though. :)

fodinabor updated this revision to Diff 343715.May 7 2021, 10:26 AM

clang-format file

Also, would it make sense to un-hide and document the flag now, given it actually is useful now?

Also, would it make sense to un-hide and document the flag now, given it actually is useful now?

You may document the effect of -cfg-func-name in docs/Passes.rst

llvm/test/Other/cfg-printer-filter.ll
1

The most common style is ; RUN

Add a comment, e.g. ;; Both f and func are dumped because their names contain the pattern f` as a substring.`

4

It will be robust to rm -f %t.other.dot first before testing this.

A stale (e.g. when testing the feature) %t.other.dot file could cause the test to fail.

11

Delete

40

Delete trailing blank lines

fodinabor marked 4 inline comments as done.

Incorporate review of the test and document the behavior in Passes.rst.

MaskRay accepted this revision.Jun 16 2021, 10:17 AM

Thanks!

This revision is now accepted and ready to land.Jun 16 2021, 10:17 AM