Fix some constructs that gcc-4.4 warns about.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51591 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp
index 7dd94f5..7feb174 100644
--- a/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -148,7 +148,7 @@
Argument *PtrArg = PointerArgs[i].first;
if (isByVal) {
const Type *AgTy = cast<PointerType>(PtrArg->getType())->getElementType();
- if (const StructType *STy = dyn_cast<StructType>(AgTy))
+ if (const StructType *STy = dyn_cast<StructType>(AgTy)) {
if (maxElements > 0 && STy->getNumElements() > maxElements) {
DOUT << "argpromotion disable promoting argument '"
<< PtrArg->getName() << "' because it would require adding more "
@@ -170,6 +170,7 @@
continue;
}
}
+ }
}
// Otherwise, see if we can promote the pointer to its value.
diff --git a/lib/Transforms/Scalar/JumpThreading.cpp b/lib/Transforms/Scalar/JumpThreading.cpp
index 407d081..4e57f0e 100644
--- a/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/lib/Transforms/Scalar/JumpThreading.cpp
@@ -282,8 +282,8 @@
// If this is a binary operator tree of the same AND/OR opcode, check the
// LHS/RHS.
if (BinaryOperator *BO = dyn_cast<BinaryOperator>(V))
- if (isAnd && BO->getOpcode() == Instruction::And ||
- !isAnd && BO->getOpcode() == Instruction::Or) {
+ if ((isAnd && BO->getOpcode() == Instruction::And) ||
+ (!isAnd && BO->getOpcode() == Instruction::Or)) {
if (ProcessBranchOnLogical(BO->getOperand(0), BB, isAnd))
return true;
if (ProcessBranchOnLogical(BO->getOperand(1), BB, isAnd))