diff options
author | Chris Lattner <sabre@nondot.org> | 2008-08-20 22:27:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-08-20 22:27:40 +0000 |
commit | b078e2833856558410c56793b840df3b72b2f538 (patch) | |
tree | 6b0bd8641b6f0b230626aa8155fe1f54444c21a5 /llvm/lib | |
parent | 1be92d297aa69ba19fe3b06c9632b73de0ce53c2 (diff) | |
download | bcm5719-llvm-b078e2833856558410c56793b840df3b72b2f538.tar.gz bcm5719-llvm-b078e2833856558410c56793b840df3b72b2f538.zip |
Add a new ConstantExpr::getWithOperands that takes any array of operands
instead of requiring an std::vector.
llvm-svn: 55084
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/VMCore/Constants.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp index bb8fa655565..df1ac086b77 100644 --- a/llvm/lib/VMCore/Constants.cpp +++ b/llvm/lib/VMCore/Constants.cpp @@ -879,10 +879,10 @@ ConstantExpr::getWithOperandReplaced(unsigned OpNo, Constant *Op) const { /// operands replaced with the specified values. The specified operands must /// match count and type with the existing ones. Constant *ConstantExpr:: -getWithOperands(const std::vector<Constant*> &Ops) const { - assert(Ops.size() == getNumOperands() && "Operand count mismatch!"); +getWithOperands(Constant* const *Ops, unsigned NumOps) const { + assert(NumOps == getNumOperands() && "Operand count mismatch!"); bool AnyChange = false; - for (unsigned i = 0, e = Ops.size(); i != e; ++i) { + for (unsigned i = 0; i != NumOps; ++i) { assert(Ops[i]->getType() == getOperand(i)->getType() && "Operand type mismatch!"); AnyChange |= Ops[i] != getOperand(i); @@ -913,7 +913,7 @@ getWithOperands(const std::vector<Constant*> &Ops) const { case Instruction::ShuffleVector: return ConstantExpr::getShuffleVector(Ops[0], Ops[1], Ops[2]); case Instruction::GetElementPtr: - return ConstantExpr::getGetElementPtr(Ops[0], &Ops[1], Ops.size()-1); + return ConstantExpr::getGetElementPtr(Ops[0], &Ops[1], NumOps-1); case Instruction::ICmp: case Instruction::FCmp: case Instruction::VICmp: |