[PATCH] Refactor: Simplify boolean conditional return statements in llvm/lib/IR
Richard
legalize at xmission.com
Mon May 25 07:12:23 PDT 2015
================
Comment at: lib/IR/Instructions.cpp:1375
@@ -1374,5 +1374,3 @@
bool ExtractElementInst::isValidOperands(const Value *Val, const Value *Index) {
- if (!Val->getType()->isVectorTy() || !Index->getType()->isIntegerTy())
- return false;
- return true;
+ return !(!Val->getType()->isVectorTy() || !Index->getType()->isIntegerTy());
}
----------------
craig.topper wrote:
> Push the negate through
Fixed.
================
Comment at: lib/IR/Instructions.cpp:2603
@@ -2604,6 +2602,3 @@
- if (DestTy->isX86_MMXTy() || SrcTy->isX86_MMXTy())
- return false;
-
- return true;
+ return !(DestTy->isX86_MMXTy() || SrcTy->isX86_MMXTy());
}
----------------
craig.topper wrote:
> Push the negate through
Fixed.
================
Comment at: lib/IR/Verifier.cpp:1515
@@ -1514,6 +1514,3 @@
|| (LastIndex == AttributeSet::FunctionIndex
- && (LastSlot == 0 || Attrs.getSlotIndex(LastSlot - 1) <= Params)))
- return true;
-
- return false;
+ && (LastSlot == 0 || Attrs.getSlotIndex(LastSlot - 1) <= Params));
}
----------------
craig.topper wrote:
> Operators should go on end of previous lines.
Fixed.
http://reviews.llvm.org/D9974
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list