From: Chris Lattner Date: Mon, 12 Jul 2004 20:35:11 +0000 (+0000) Subject: implement new helper method X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b370c7a41a7bd43c4af2d7858556b25e7ac802dc;p=oota-llvm.git implement new helper method git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14776 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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() {