Page MenuHomePhabricator

[analyzer] Remove the default value arg from getChecker*Option
Needs ReviewPublic

Authored by Szelethus on Mar 10 2019, 2:36 PM.



Since D57922, the config table contains every checker option, and it's default value, so having it as an argument for getChecker*Option is redundant.

By the time any of the getChecker*Option function is called, we verified the value in CheckerRegistry (after D57860), so we can confidently assert here, as any irregularities detected at this point must be a programmer error. However, in compatibility mode, verification won't happen, so the default value must be restored.

This implies something else, other than adding removing one more potential point of failure -- debug.ConfigDumper will always contain valid values, and that's kinda nice :D

Diff Detail

Event Timeline

Szelethus created this revision.Mar 10 2019, 2:36 PM

This is straightforward.

Szelethus updated this revision to Diff 190996.Mar 16 2019, 1:02 PM

Remove the default argument from the plugin, also add a test case for it.

NoQ accepted this revision.Mon, Mar 25, 2:28 PM
NoQ added inline comments.

Even though operator*() would have asserted that there's a value, i really appreciate the user-friendly assert message.

rnkovacs added inline comments.Tue, Mar 26, 4:38 AM

Sorry for the impertinence, but there's a typo: CheckerRegisrty.


And the same typo here.