implement new helper method

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14776 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-07-12 20:35:11 +00:00
parent aec6dd5bbc
commit b370c7a41a

View File

@ -997,6 +997,14 @@ Constant *ConstantStruct::get(const StructType *Ty,
return ConstantAggregateZero::get(Ty);
}
Constant *ConstantStruct::get(const std::vector<Constant*> &V) {
std::vector<const Type*> 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() {