[PATCH] Refactor: Simplify boolean expressions

David Blaikie dblaikie at gmail.com
Sun Mar 8 16:41:50 PDT 2015


Looks good to me - please commit. One or two optional comments.


================
Comment at: lib/IR/InlineAsm.cpp:78
@@ -77,3 +77,3 @@
   // Initialize
-  isMultipleAlternative = (multipleAlternativeCount > 1 ? true : false);
+  isMultipleAlternative = (multipleAlternativeCount > 1);
   if (isMultipleAlternative) {
----------------
could drop the parens here (before/after/at the same time/not at all)

================
Comment at: lib/MC/MCParser/DarwinAsmParser.cpp:629
@@ -628,3 +628,3 @@
 
-  if (getContext().getSecureLogUsed() != false)
+  if (getContext().getSecureLogUsed())
     return Error(IDLoc, ".secure_log_unique specified multiple times");
----------------
aside: I wonder if this (& the previous function, getGenDwarfForAsembly) should be 'is' rather than 'get'

http://reviews.llvm.org/D8154

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list