diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index c8e59609e9e..6a547e05ae3 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -997,6 +997,14 @@ Constant *ConstantStruct::get(const StructType *Ty, return ConstantAggregateZero::get(Ty); } +Constant *ConstantStruct::get(const std::vector &V) { + std::vector StructEls; + StructEls.reserve(V.size()); + for (unsigned i = 0, e = V.size(); i != e; ++i) + StructEls.push_back(V[i]->getType()); + return get(StructType::get(StructEls), V); +} + // destroyConstant - Remove the constant from the constant table... // void ConstantStruct::destroyConstant() {