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
This commit is contained in:
Duncan Sands 2008-05-27 11:50:51 +00:00
parent 3d8710e80a
commit 43e2a03530
6 changed files with 12 additions and 8 deletions

View File

@ -2724,13 +2724,14 @@ unsigned Andersens::UniteNodes(unsigned First, unsigned Second,
DOUT << "\n";
if (SDTActive)
if (SDT[Second] >= 0)
if (SDT[Second] >= 0) {
if (SDT[First] < 0)
SDT[First] = SDT[Second];
else {
UniteNodes( FindNode(SDT[First]), FindNode(SDT[Second]) );
First = FindNode(First);
}
}
return First;
}

View File

@ -37,11 +37,12 @@ static bool RedefinesSuperRegPart(const MachineInstr *MI, unsigned SubReg,
const MachineOperand &MO = MI->getOperand(i);
if (!MO.isRegister())
continue;
if (TRI->isSuperRegister(SubReg, MO.getReg()))
if (TRI->isSuperRegister(SubReg, MO.getReg())) {
if (MO.isUse())
SeenSuperUse = true;
else if (MO.isImplicit())
SeenSuperDef = true;
}
}
return SeenSuperDef && SeenSuperUse;

View File

@ -2986,7 +2986,7 @@ SelectionDAG::getLoad(ISD::MemIndexedMode AM, ISD::LoadExtType ExtType,
}
bool Indexed = AM != ISD::UNINDEXED;
assert(Indexed || Offset.getOpcode() == ISD::UNDEF &&
assert((Indexed || Offset.getOpcode() == ISD::UNDEF) &&
"Unindexed load with an offset!");
SDVTList VTs = Indexed ?

View File

@ -3205,11 +3205,12 @@ void CWriter::visitShuffleVectorInst(ShuffleVectorInst &SVI) {
Out << "((";
printType(Out, PointerType::getUnqual(EltTy));
Out << ")(&" << GetValueName(Op)
<< "))[" << (SrcVal & NumElts-1) << "]";
<< "))[" << (SrcVal & (NumElts-1)) << "]";
} else if (isa<ConstantAggregateZero>(Op) || isa<UndefValue>(Op)) {
Out << "0";
} else {
printConstant(cast<ConstantVector>(Op)->getOperand(SrcVal & NumElts-1));
printConstant(cast<ConstantVector>(Op)->getOperand(SrcVal &
(NumElts-1)));
}
}
}

View File

@ -148,7 +148,7 @@ bool ArgPromotion::PromoteArguments(CallGraphNode *CGN) {
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 @@ bool ArgPromotion::PromoteArguments(CallGraphNode *CGN) {
continue;
}
}
}
}
// Otherwise, see if we can promote the pointer to its value.

View File

@ -282,8 +282,8 @@ bool JumpThreading::ProcessBranchOnLogical(Value *V, BasicBlock *BB,
// 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))