mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Move the ConstantStruct factory methods over to LLVMContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75830 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user