1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

implement new helper method

llvm-svn: 14776
This commit is contained in:
Chris Lattner 2004-07-12 20:35:11 +00:00
parent 9fc90f37fd
commit 3f023d6df9

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() {