comparison gen/tocall.cpp @ 632:df196c8dea26

Updated to latest LLVM trunk, function notes have been removed and merged with parameter attributes, which have been renamed to just attributes. Nothing seems to have broke!
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Wed, 01 Oct 2008 23:17:14 +0200
parents 26fce59fe80a
children 30b42a283c8e
comparison
equal deleted inserted replaced
629:607b6b5819a7 632:df196c8dea26
102 return NULL; 102 return NULL;
103 } 103 }
104 104
105 ////////////////////////////////////////////////////////////////////////////////////////// 105 //////////////////////////////////////////////////////////////////////////////////////////
106 106
107 void DtoBuildDVarArgList(std::vector<LLValue*>& args, llvm::PAListPtr& palist, TypeFunction* tf, Expressions* arguments, size_t argidx) 107 void DtoBuildDVarArgList(std::vector<LLValue*>& args, llvm::AttrListPtr& palist, TypeFunction* tf, Expressions* arguments, size_t argidx)
108 { 108 {
109 Logger::println("doing d-style variadic arguments"); 109 Logger::println("doing d-style variadic arguments");
110 110
111 std::vector<const LLType*> vtypes; 111 std::vector<const LLType*> vtypes;
112 112
233 // get llvm argument iterator, for types 233 // get llvm argument iterator, for types
234 LLFunctionType::param_iterator argbegin = callableTy->param_begin(); 234 LLFunctionType::param_iterator argbegin = callableTy->param_begin();
235 LLFunctionType::param_iterator argiter = argbegin; 235 LLFunctionType::param_iterator argiter = argbegin;
236 236
237 // parameter attributes 237 // parameter attributes
238 llvm::PAListPtr palist; 238 llvm::AttrListPtr palist;
239 239
240 // return attrs 240 // return attrs
241 if (tf->retAttrs) 241 if (tf->retAttrs)
242 palist = palist.addAttr(0, tf->retAttrs); 242 palist = palist.addAttr(0, tf->retAttrs);
243 243
248 if (retinptr) 248 if (retinptr)
249 { 249 {
250 LLValue* retvar = DtoAlloca(argiter->get()->getContainedType(0), ".rettmp"); 250 LLValue* retvar = DtoAlloca(argiter->get()->getContainedType(0), ".rettmp");
251 ++argiter; 251 ++argiter;
252 args.push_back(retvar); 252 args.push_back(retvar);
253 palist = palist.addAttr(1, llvm::ParamAttr::StructRet); 253 palist = palist.addAttr(1, llvm::Attribute::StructRet);
254 } 254 }
255 255
256 // then comes a context argument... 256 // then comes a context argument...
257 if(thiscall || delegatecall || nestedcall) 257 if(thiscall || delegatecall || nestedcall)
258 { 258 {
362 // set calling convention and parameter attributes 362 // set calling convention and parameter attributes
363 if (dfnval && dfnval->func) 363 if (dfnval && dfnval->func)
364 { 364 {
365 LLFunction* llfunc = llvm::dyn_cast<LLFunction>(dfnval->val); 365 LLFunction* llfunc = llvm::dyn_cast<LLFunction>(dfnval->val);
366 if (llfunc && llfunc->isIntrinsic()) 366 if (llfunc && llfunc->isIntrinsic())
367 palist = llvm::Intrinsic::getParamAttrs((llvm::Intrinsic::ID)llfunc->getIntrinsicID()); 367 palist = llvm::Intrinsic::getAttributes((llvm::Intrinsic::ID)llfunc->getIntrinsicID());
368 else 368 else
369 call->setCallingConv(callconv); 369 call->setCallingConv(callconv);
370 } 370 }
371 else 371 else
372 call->setCallingConv(callconv); 372 call->setCallingConv(callconv);
373 call->setParamAttrs(palist); 373 call->setAttributes(palist);
374 374
375 return new DImValue(resulttype, retllval); 375 return new DImValue(resulttype, retllval);
376 } 376 }
377
378
379
380
381
382
383
384
385
386
387
388
389