Page MenuHomePhabricator

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

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
2

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.`

5

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.

12

Delete

41

Delete trailing blank lines

fodinabor marked 4 inline comments as done.

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