This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Clean checker options from DefaultBool to bool (NFC)
ClosedPublic

Authored by vabridgers on Apr 10 2022, 5:48 AM.

Details

Summary

A recent review emphasized the preference to use DefaultBool instead of
bool for checker options. This change is a NFC and cleans up some of the
instances where bool was used, and could be changed to DefaultBool.

Diff Detail

Event Timeline

vabridgers created this revision.Apr 10 2022, 5:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 10 2022, 5:48 AM
vabridgers requested review of this revision.Apr 10 2022, 5:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 10 2022, 5:48 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
steakhal requested changes to this revision.Apr 19 2022, 2:59 AM

A recent review emphasized the preference to use DefaultBool instead of bool for checker options.

What I wanted to highlight is that we should aim for consistency. We should either use that everywhere or nowhere.

To be fair, we should probably use raw bools instead.
They could not only default to false, but to true as well.

In addition to this, we should prefer the c++ way of initializing these at the declaration directly to either of those values.
IMO we don't need this DefaultBool abstraction.

This revision now requires changes to proceed.Apr 19 2022, 2:59 AM

refactor patch to remove DefaultBool, replace with bool as suggested

Hi @steakhal, I believe I've addressed the comments. Please have a look and let me know if this is what you were after. Best!

steakhal accepted this revision.Apr 23 2022, 9:22 AM

Good stuff. Update the summary and title, and I think good to go.

In addition to this, we should do something similar with the rest of the checker options and initialize them at the declaration. But that is a different story.

This revision is now accepted and ready to land.Apr 23 2022, 9:22 AM
vabridgers retitled this revision from [analyzer] Clean checker options from bool to DefaultBool (NFC) to [analyzer] Clean checker options from DefaultBool to bool (NFC).Apr 23 2022, 12:48 PM
vabridgers edited the summary of this revision. (Show Details)