Silence warnings
authorChris Lattner <sabre@nondot.org>
Sat, 8 Jan 2005 19:34:41 +0000 (19:34 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 8 Jan 2005 19:34:41 +0000 (19:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19379 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/SCCP.cpp
lib/Transforms/Scalar/ScalarReplAggregates.cpp

index b51f3ad68cb52699eb5b5e831aa9fa2265b15575..c769b549916162707e7f0bb86768f89cbc36e793 100644 (file)
@@ -771,12 +771,12 @@ static Constant *GetGEPGlobalInitializer(Constant *C, ConstantExpr *CE) {
       ConstantStruct *CS = dyn_cast<ConstantStruct>(C);
       if (CS == 0) return 0;
       if (CU->getValue() >= CS->getNumOperands()) return 0;
-      C = CS->getOperand(CU->getValue());
+      C = CS->getOperand((unsigned)CU->getValue());
     } else if (ConstantSInt *CS = dyn_cast<ConstantSInt>(CE->getOperand(i))) {
       ConstantArray *CA = dyn_cast<ConstantArray>(C);
       if (CA == 0) return 0;
       if ((uint64_t)CS->getValue() >= CA->getNumOperands()) return 0;
-      C = CA->getOperand(CS->getValue());
+      C = CA->getOperand((unsigned)CS->getValue());
     } else
       return 0;
   return C;
index 8c8df54c2e08bd2630f5c30f52ea4016b91de343..f934f1f12747cccb9c10621d56bbf18fd2f82bb6 100644 (file)
@@ -183,7 +183,8 @@ bool SROA::performScalarRepl(Function &F) {
       Instruction *User = cast<Instruction>(AI->use_back());
       GetElementPtrInst *GEPI = cast<GetElementPtrInst>(User);
       // We now know that the GEP is of the form: GEP <ptr>, 0, <cst>
-      uint64_t Idx = cast<ConstantInt>(GEPI->getOperand(2))->getRawValue();
+      unsigned Idx = 
+         (unsigned)cast<ConstantInt>(GEPI->getOperand(2))->getRawValue();
       
       assert(Idx < ElementAllocas.size() && "Index out of range?");
       AllocaInst *AllocaToUse = ElementAllocas[Idx];