Move the ConstantStruct factory methods over to LLVMContext.
authorOwen Anderson <resistor@mac.com>
Wed, 15 Jul 2009 21:00:46 +0000 (21:00 +0000)
committerOwen Anderson <resistor@mac.com>
Wed, 15 Jul 2009 21:00:46 +0000 (21:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75830 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Constants.h
lib/VMCore/Constants.cpp
lib/VMCore/LLVMContext.cpp

index 27e225bc3799503e05e07d4ccda220b3c09c0e16..12777025c6db66e5183bc988eaa65589069b8e1c 100644 (file)
@@ -379,12 +379,6 @@ public:
   /// get() - Static factory methods - Return objects of the specified value
   ///
   static Constant *get(const StructType *T, const std::vector<Constant*> &V);
-  static Constant *get(const std::vector<Constant*> &V, bool Packed = false);
-  static Constant *get(Constant*const* Vals, unsigned NumVals,
-                       bool Packed = false) {
-    // FIXME: make this the primary ctor method.
-    return get(std::vector<Constant*>(Vals, Vals+NumVals), Packed);
-  }
   
   /// Transparently provide more efficient getOperand methods.
   DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Constant);
index 5c7c288ce9e9b95a68c91ec67d9899e00e5b025d..b123f85931b0ae667400738a336fc86cf342f279 100644 (file)
@@ -1371,14 +1371,6 @@ Constant *ConstantStruct::get(const StructType *Ty,
   return ConstantAggregateZero::get(Ty);
 }
 
-Constant *ConstantStruct::get(const std::vector<Constant*> &V, bool packed) {
-  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, packed), V);
-}
-
 // destroyConstant - Remove the constant from the constant table...
 //
 void ConstantStruct::destroyConstant() {
index 90230f0420483e267030f5093b485b4e60350615..e359ae33df87744576010d54acbb0865a8fde5e1 100644 (file)
@@ -146,13 +146,18 @@ Constant* LLVMContext::getConstantStruct(const StructType* T,
 }
 
 Constant* LLVMContext::getConstantStruct(const std::vector<Constant*>& V,
-                                         bool Packed) {
-  return ConstantStruct::get(V, Packed);
+                                         bool packed) {
+  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 getConstantStruct(getStructType(StructEls, packed), V);
 }
 
 Constant* LLVMContext::getConstantStruct(Constant* const *Vals,
                                          unsigned NumVals, bool Packed) {
-  return ConstantStruct::get(Vals, NumVals, Packed);
+  // FIXME: make this the primary ctor method.
+  return getConstantStruct(std::vector<Constant*>(Vals, Vals+NumVals), Packed);
 }