From: Bill Wendling Date: Sat, 10 May 2008 19:59:59 +0000 (+0000) Subject: Remove warnings when using -Wshorten-64-to-32. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c2e735359f0698582d67fda313926a6436833b05;p=oota-llvm.git Remove warnings when using -Wshorten-64-to-32. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50952 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index f2afd79e6dd..b8f04c40b0d 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -960,14 +960,14 @@ public: InputIterator ArgBegin, InputIterator ArgEnd, const std::string &Name = "", Instruction *InsertBefore = 0) { - return new(ArgEnd - ArgBegin + 1) + return new((unsigned)(ArgEnd - ArgBegin + 1)) CallInst(Func, ArgBegin, ArgEnd, Name, InsertBefore); } template static CallInst *Create(Value *Func, InputIterator ArgBegin, InputIterator ArgEnd, const std::string &Name, BasicBlock *InsertAtEnd) { - return new(ArgEnd - ArgBegin + 1) + return new((unsigned)(ArgEnd - ArgBegin + 1)) CallInst(Func, ArgBegin, ArgEnd, Name, InsertAtEnd); } static CallInst *Create(Value *F, Value *Actual, const std::string& Name = "", @@ -1685,7 +1685,7 @@ public: ~BranchInst() { if (NumOperands == 1) - NumOperands = (unsigned)(uintptr_t)((Use*)this - OperandList); + NumOperands = (unsigned)((Use*)this - OperandList); } /// Transparently provide more efficient getOperand methods.