aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore
diff options
context:
space:
mode:
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Constants.cpp8
-rw-r--r--lib/VMCore/LLVMContext.cpp11
2 files changed, 8 insertions, 11 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index 5c7c288ce9..b123f85931 100644
--- a/lib/VMCore/Constants.cpp
+++ b/lib/VMCore/Constants.cpp
@@ -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() {
diff --git a/lib/VMCore/LLVMContext.cpp b/lib/VMCore/LLVMContext.cpp
index 90230f0420..e359ae33df 100644
--- a/lib/VMCore/LLVMContext.cpp
+++ b/lib/VMCore/LLVMContext.cpp
@@ -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);
}