appendToVector used the wrong overload of SmallVector::append, resulting
in it appending the same element to a vector `getSize()` times. This did
not cause a problem when initially committed because appendToVector was
only used to append 1-element operands.
This changes appendToVector to use the correct overload of append().
Testing: ./unittests/IR/IRTests --gtest_filter='*DIExpressionTest*'
llvm-svn: 336466
/// Append the elements of this operand to \p V.
void appendToVector(SmallVectorImpl<uint64_t> &V) const {
- V.append(getSize(), *get());
+ V.append(get(), get() + getSize());
}
};
StackValue = false;
}
}
- Ops.push_back(Op.getOp());
- for (unsigned I = 0; I < Op.getNumArgs(); ++I)
- Ops.push_back(Op.getArg(I));
+ Op.appendToVector(Ops);
}
if (StackValue)
Ops.push_back(dwarf::DW_OP_stack_value);
continue;
}
}
- Ops.push_back(Op.getOp());
- for (unsigned I = 0; I < Op.getNumArgs(); ++I)
- Ops.push_back(Op.getArg(I));
+ Op.appendToVector(Ops);
}
}
Ops.push_back(dwarf::DW_OP_LLVM_fragment);