summaryrefslogtreecommitdiff
path: root/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-08-20 22:27:40 +0000
committerChris Lattner <sabre@nondot.org>2008-08-20 22:27:40 +0000
commitb054bfd3ea50d599fe14bce1b74e39b686724dd9 (patch)
treef7bd82e4d4bd1b664631e76d0f9d995716d96719 /lib/VMCore
parent83babdea5d4ed19c7ed0be225e8be98463914ffb (diff)
downloadllvm-b054bfd3ea50d599fe14bce1b74e39b686724dd9.tar.gz
llvm-b054bfd3ea50d599fe14bce1b74e39b686724dd9.tar.bz2
llvm-b054bfd3ea50d599fe14bce1b74e39b686724dd9.tar.xz
Add a new ConstantExpr::getWithOperands that takes any array of operands
instead of requiring an std::vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55084 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Constants.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index bb8fa65556..df1ac086b7 100644
--- a/lib/VMCore/Constants.cpp
+++ b/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: