This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Fix Clang-tidy modernize-use-bool-literals in generated code.
ClosedPublic

Authored by Eugene.Zelenko on May 12 2016, 9:33 AM.

Details

Diff Detail

Repository
rL LLVM

Event Timeline

Eugene.Zelenko retitled this revision from to [Clang] Fix Clang-tidy modernize-use-bool-literals in generated code..
Eugene.Zelenko updated this object.
Eugene.Zelenko added reviewers: hans, aaron.ballman.
Eugene.Zelenko set the repository for this revision to rL LLVM.
Eugene.Zelenko added a subscriber: cfe-commits.
hans added inline comments.May 12 2016, 9:50 AM
utils/TableGen/ClangAttrEmitter.cpp
338 ↗(On Diff #57058)

Everything up to the " = " part is the same for the two branches of the if statements.

Maybe re-write this as

OS << "\n\n  static const .... = ";
if (getType() == "bool")
  OS << true or false..
else
  OS << Default..

Implement Hans' suggestion.

hans accepted this revision.May 12 2016, 3:28 PM
hans edited edge metadata.

lgtm

This revision is now accepted and ready to land.May 12 2016, 3:28 PM
This revision was automatically updated to reflect the committed changes.