This is an archive of the discontinued LLVM Phabricator instance.

Allow overriding flag names in diagnostics.
ClosedPublic

Authored by dnovillo on Apr 21 2014, 11:34 AM.

Details

Summary

This allows callers of Diags.Report() to override the name of the flag
associated with the diagnostic. This is useful in cases like the -Rpass
flag, where we want the diagnostic to show the name of the pass that
matched the pattern. Instead of showing "... [-Rpass]", this allows
us to show "... [-Rpass=passname]".

Diff Detail

Event Timeline

dnovillo updated this revision to Unknown Object (????).Apr 21 2014, 4:03 PM

Instead of an override, provide a flag value.

As we discussed offline, it seems cleaner to offer callers to provide
an additional value to the option, instead of overriding it completely.

This changes the patch so that callers provide an additional value to
the diagnostic. This value is emitted as the suffix "=value" when
displaying the flag name.

rsmith accepted this revision.Apr 21 2014, 4:15 PM

LGTM

dnovillo closed this revision.Apr 22 2014, 9:21 AM