From 2cc34627bb870b6a304efe673736fed2f6a63800 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 8 Jan 2005 19:34:41 +0000 Subject: [PATCH] Silence warnings git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19379 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/SCCP.cpp | 4 ++-- lib/Transforms/Scalar/ScalarReplAggregates.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index b51f3ad68cb..c769b549916 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -771,12 +771,12 @@ static Constant *GetGEPGlobalInitializer(Constant *C, ConstantExpr *CE) { ConstantStruct *CS = dyn_cast(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(CE->getOperand(i))) { ConstantArray *CA = dyn_cast(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; diff --git a/lib/Transforms/Scalar/ScalarReplAggregates.cpp b/lib/Transforms/Scalar/ScalarReplAggregates.cpp index 8c8df54c2e0..f934f1f1274 100644 --- a/lib/Transforms/Scalar/ScalarReplAggregates.cpp +++ b/lib/Transforms/Scalar/ScalarReplAggregates.cpp @@ -183,7 +183,8 @@ bool SROA::performScalarRepl(Function &F) { Instruction *User = cast(AI->use_back()); GetElementPtrInst *GEPI = cast(User); // We now know that the GEP is of the form: GEP , 0, - uint64_t Idx = cast(GEPI->getOperand(2))->getRawValue(); + unsigned Idx = + (unsigned)cast(GEPI->getOperand(2))->getRawValue(); assert(Idx < ElementAllocas.size() && "Index out of range?"); AllocaInst *AllocaToUse = ElementAllocas[Idx];