Mercurial > projects > ldc
comparison gen/tocall.cpp @ 1569:755abafbf25d
Push the context through StructType::get.
Requires LLVM >= 78258. Also remove old #if's.
author | Benjamin Kramer <benny.kra@gmail.com> |
---|---|
date | Thu, 06 Aug 2009 01:47:39 +0200 |
parents | d6e8d5db259f |
children | 8d086d552909 |
comparison
equal
deleted
inserted
replaced
1568:a591aa6bd6dc | 1569:755abafbf25d |
---|---|
158 while (gah_sz < asz) | 158 while (gah_sz < asz) |
159 { | 159 { |
160 gah.push_back(DtoSize_t()); | 160 gah.push_back(DtoSize_t()); |
161 gah_sz += PTRSIZE; | 161 gah_sz += PTRSIZE; |
162 } | 162 } |
163 vtypes.back() = LLStructType::get(gah, true); | 163 vtypes.back() = LLStructType::get(gIR->context(), gah, true); |
164 } | 164 } |
165 } | 165 } |
166 } | 166 } |
167 const LLStructType* vtype = LLStructType::get(vtypes); | 167 const LLStructType* vtype = LLStructType::get(gIR->context(), vtypes); |
168 | 168 |
169 if (Logger::enabled()) | 169 if (Logger::enabled()) |
170 Logger::cout() << "d-variadic argument struct type:\n" << *vtype << '\n'; | 170 Logger::cout() << "d-variadic argument struct type:\n" << *vtype << '\n'; |
171 | 171 |
172 LLValue* mem = DtoRawAlloca(vtype, 0, "_argptr_storage"); | 172 LLValue* mem = DtoRawAlloca(vtype, 0, "_argptr_storage"); |
205 // put data in d-array | 205 // put data in d-array |
206 std::vector<LLConstant*> pinits; | 206 std::vector<LLConstant*> pinits; |
207 pinits.push_back(DtoConstSize_t(vtype->getNumElements())); | 207 pinits.push_back(DtoConstSize_t(vtype->getNumElements())); |
208 pinits.push_back(llvm::ConstantExpr::getBitCast(typeinfomem, getPtrToType(typeinfotype))); | 208 pinits.push_back(llvm::ConstantExpr::getBitCast(typeinfomem, getPtrToType(typeinfotype))); |
209 const LLType* tiarrty = DtoType(Type::typeinfo->type->arrayOf()); | 209 const LLType* tiarrty = DtoType(Type::typeinfo->type->arrayOf()); |
210 tiinits = LLConstantStruct::get(pinits); | 210 tiinits = LLConstantStruct::get(gIR->context(), pinits); |
211 LLValue* typeinfoarrayparam = new llvm::GlobalVariable(*gIR->module, tiarrty, | 211 LLValue* typeinfoarrayparam = new llvm::GlobalVariable(*gIR->module, tiarrty, |
212 true, llvm::GlobalValue::InternalLinkage, tiinits, "._arguments.array"); | 212 true, llvm::GlobalValue::InternalLinkage, tiinits, "._arguments.array"); |
213 | 213 |
214 llvm::AttributeWithIndex Attr; | 214 llvm::AttributeWithIndex Attr; |
215 // specify arguments | 215 // specify arguments |