[llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp
Chris Lattner
lattner at cs.uiuc.edu
Mon Jul 12 13:35:21 PDT 2004
Changes in directory llvm/lib/VMCore:
Constants.cpp updated: 1.93 -> 1.94
---
Log message:
implement new helper method
---
Diffs of the changes: (+8 -0)
Index: llvm/lib/VMCore/Constants.cpp
diff -u llvm/lib/VMCore/Constants.cpp:1.93 llvm/lib/VMCore/Constants.cpp:1.94
--- llvm/lib/VMCore/Constants.cpp:1.93 Sun Jul 4 06:51:24 2004
+++ llvm/lib/VMCore/Constants.cpp Mon Jul 12 15:35:11 2004
@@ -997,6 +997,14 @@
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() {
More information about the llvm-commits
mailing list