This is an archive of the discontinued LLVM Phabricator instance.

[pp-trace] Delete -ignore and add a new option -callbacks
ClosedPublic

Authored by MaskRay on Mar 13 2019, 6:50 AM.

Details

Summary

-ignore specifies a list of PP callbacks to ignore. It cannot express a
whitelist, which may be more useful than a blacklist.
Add a new option -callbacks to replace it.

-ignore= (default) => -callbacks='*' (default)
-ignore=FileChanged,FileSkipped => -callbacks='*,-FileChanged,-FileSkipped'

-callbacks='Macro*' : print only MacroDefined,MacroExpands,MacroUndefined,...

Diff Detail

Repository
rL LLVM

Event Timeline

MaskRay created this revision.Mar 13 2019, 6:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 13 2019, 6:50 AM

I think the release notes should be updated to mention that a previously-supported option has been removed and that there's a new option available as a replacement; I don't think we have any other docs for pp-trace to worry about updating, do we?

pp-trace/PPTrace.cpp
70–71 ↗(On Diff #190405)

Can re-flow the string literal.

MaskRay updated this revision to Diff 190935.Mar 15 2019, 6:35 PM

Reflow comments

MaskRay updated this revision to Diff 190936.Mar 15 2019, 6:35 PM

Reflow string literal

Harbormaster completed remote builds in B29239: Diff 190936.
MaskRay updated this revision to Diff 190937.Mar 15 2019, 6:39 PM
MaskRay marked an inline comment as done.

Update ReleaseNotes.rst

I think the release notes should be updated to mention that a previously-supported option has been removed and that there's a new option available as a replacement; I don't think we have any other docs for pp-trace to worry about updating, do we?

Added a note to docs/ReleaseNotes.rst. I can't find other documentation mentioning this tool. This tool isn't used a lot...

@aaron.ballman Does the release note look good now? 😊

aaron.ballman accepted this revision.Mar 18 2019, 5:44 AM

LGTM aside from some small nits. Feel free to fix and commit without further review if you'd like.

docs/ReleaseNotes.rst
141 ↗(On Diff #190937)

How about: Added a new option, -callbacks, to filter preprocessor callbacks; replaces the -ignore option.

pp-trace/PPTrace.cpp
168 ↗(On Diff #190937)

Do you want to trim the pattern, in case the user specifies a pattern with whitespace around the commas? e.g., -callbacks 'foo, bar, baz' (You should add a test for this as well.)

This revision is now accepted and ready to land.Mar 18 2019, 5:44 AM
MaskRay updated this revision to Diff 191075.Mar 18 2019, 6:27 AM
MaskRay retitled this revision from [pp-trace] Delete -ignore and add generalized -callbacks to [pp-trace] Delete -ignore and add a new option -callbacks.
MaskRay edited the summary of this revision. (Show Details)

Add a test with spaces around patterns

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 18 2019, 6:29 AM