From 0574ab2190fe13b84f5b794b7186b0bf86dcc8d2 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Tue, 26 Feb 2008 19:15:26 +0000 Subject: Avoid const_casts git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47616 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Instructions.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/VMCore/Instructions.cpp') diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index 8a375048bf..ffd93dbc62 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -618,25 +618,25 @@ ReturnInst::ReturnInst(const std::vector &retVals) init(&retVals[0], retVals.size()); } -void ReturnInst::init(const Value * const* retVals, unsigned N) { +void ReturnInst::init(Value * const* retVals, unsigned N) { assert (N > 0 && "Invalid operands numbers in ReturnInst init"); NumOperands = N; if (NumOperands == 1) { - const Value *V = *retVals; + Value *V = *retVals; if (V->getType() == Type::VoidTy) return; - RetVal.init(const_cast(V), this); + RetVal.init(V, this); return; } Use *OL = OperandList = new Use[NumOperands]; for (unsigned i = 0; i < NumOperands; ++i) { - const Value *V = *retVals++; + Value *V = *retVals++; assert(!isa(V) && "Cannot return basic block. Probably using the incorrect ctor"); - OL[i].init(const_cast(V), this); + OL[i].init(V, this); } } -- cgit v1.2.3