[PATCH] D20213: [Clang] Fix Clang-tidy modernize-use-bool-literals in generated code.

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Thu May 12 09:50:31 PDT 2016


hans added inline comments.

================
Comment at: utils/TableGen/ClangAttrEmitter.cpp:338
@@ -310,1 +337,3 @@
+        OS << "\n\n  static const " << getType() << " Default" << getUpperName()
+           << " = " << Default << ";";
     }
----------------
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..
```


Repository:
  rL LLVM

http://reviews.llvm.org/D20213





More information about the cfe-commits mailing list