This is an archive of the discontinued LLVM Phabricator instance.

Refactor: Simplify boolean expressions in llvm-nm
AbandonedPublic

Authored by LegalizeAdulthood on Mar 22 2015, 12:39 PM.

Details

Reviewers
alexfh
rafael
Summary

Simplify boolean expressions using true and false with clang-tidy

Diff Detail

Event Timeline

LegalizeAdulthood retitled this revision from to Refactor: Simplify boolean expressions in llvm-nm.
LegalizeAdulthood updated this object.
LegalizeAdulthood edited the test plan for this revision. (Show Details)
LegalizeAdulthood added a subscriber: Unknown Object (MLST).

In article <CAENS6EtScu6-nzsJk5V+O8J1LbgBpYtQeu9NtYrMJ-UQ0Kkw1g@mail.gmail.com>,

David Blaikie <dblaikie@gmail.com> writes:

If we changed the code to:

if (x)

return true;

return false;

would it still trigger the cleanup check you're using?

Nope.

The tool explicitly looks for 'if (e) return true; else return false;'
and replaces that with 'return e;'

I'm discarding this because a variation of it has been incorporated into trunk.