Mercurial > projects > ldc
comparison gen/tocall.cpp @ 479:672eb4893b55
Move AllocaInst creation into DtoAlloca helper. Will enable special zero-init of fp80 reals' padding.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Tue, 05 Aug 2008 19:28:19 +0200 |
parents | b975f29b7256 |
children | a34078905d01 |
comparison
equal
deleted
inserted
replaced
478:b657298222d9 | 479:672eb4893b55 |
---|---|
116 if (sz < PTRSIZE) | 116 if (sz < PTRSIZE) |
117 vtypes.back() = DtoSize_t(); | 117 vtypes.back() = DtoSize_t(); |
118 } | 118 } |
119 const LLStructType* vtype = LLStructType::get(vtypes); | 119 const LLStructType* vtype = LLStructType::get(vtypes); |
120 Logger::cout() << "d-variadic argument struct type:\n" << *vtype << '\n'; | 120 Logger::cout() << "d-variadic argument struct type:\n" << *vtype << '\n'; |
121 LLValue* mem = new llvm::AllocaInst(vtype,"_argptr_storage",gIR->topallocapoint()); | 121 LLValue* mem = DtoAlloca(vtype,"_argptr_storage"); |
122 | 122 |
123 // store arguments in the struct | 123 // store arguments in the struct |
124 for (int i=begin,k=0; i<arguments->dim; i++,k++) | 124 for (int i=begin,k=0; i<arguments->dim; i++,k++) |
125 { | 125 { |
126 Expression* argexp = (Expression*)arguments->data[i]; | 126 Expression* argexp = (Expression*)arguments->data[i]; |
228 std::vector<LLValue*> args; | 228 std::vector<LLValue*> args; |
229 | 229 |
230 // return in hidden ptr is first | 230 // return in hidden ptr is first |
231 if (retinptr) | 231 if (retinptr) |
232 { | 232 { |
233 LLValue* retvar = new llvm::AllocaInst(argiter->get()->getContainedType(0), ".rettmp", gIR->topallocapoint()); | 233 LLValue* retvar = DtoAlloca(argiter->get()->getContainedType(0), ".rettmp"); |
234 ++argiter; | 234 ++argiter; |
235 args.push_back(retvar); | 235 args.push_back(retvar); |
236 palist = palist.addAttr(1, llvm::ParamAttr::StructRet); | 236 palist = palist.addAttr(1, llvm::ParamAttr::StructRet); |
237 } | 237 } |
238 | 238 |