diff options
| author | Devang Patel <dpatel@apple.com> | 2008-02-26 19:15:26 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2008-02-26 19:15:26 +0000 |
| commit | 060e79c729e6cf78504007b1f570fda16ea2e6a2 (patch) | |
| tree | 26ada8261628d36c5bcca6e7341835d0ce28f710 /llvm/lib | |
| parent | aa2617206f0a8a919f1fa9475b129b7ecebe8eb4 (diff) | |
| download | bcm5719-llvm-060e79c729e6cf78504007b1f570fda16ea2e6a2.tar.gz bcm5719-llvm-060e79c729e6cf78504007b1f570fda16ea2e6a2.zip | |
Avoid const_casts
llvm-svn: 47616
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/VMCore/Instructions.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp index 8a375048bf1..ffd93dbc622 100644 --- a/llvm/lib/VMCore/Instructions.cpp +++ b/llvm/lib/VMCore/Instructions.cpp @@ -618,25 +618,25 @@ ReturnInst::ReturnInst(const std::vector<Value *> &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<Value*>(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<BasicBlock>(V) && "Cannot return basic block. Probably using the incorrect ctor"); - OL[i].init(const_cast<Value *>(V), this); + OL[i].init(V, this); } } |

