[PATCH] Refactor: Simplify boolean expressions

Richard legalize at xmission.com
Sun Mar 8 16:49:02 PDT 2015


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

================
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");
----------------
dblaikie wrote:
> aside: I wonder if this (& the previous function, getGenDwarfForAsembly) should be 'is' rather than 'get'
I'll leave that for someone else to decide :-).

http://reviews.llvm.org/D8154

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






More information about the cfe-commits mailing list