Mercurial > projects > ldc
comparison gen/functions.cpp @ 446:7a67dedbf933
Fixed param attrs for return values (not really broken, but would be if more return attrs were added)
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Fri, 01 Aug 2008 18:07:33 +0200 |
parents | cc40db549aea |
children | 56265fa07c7d |
comparison
equal
deleted
inserted
replaced
445:cc40db549aea | 446:7a67dedbf933 |
---|---|
318 std::vector<llvm::ParamAttrsWithIndex> attrs; | 318 std::vector<llvm::ParamAttrsWithIndex> attrs; |
319 int k = 0; | 319 int k = 0; |
320 | 320 |
321 llvm::ParamAttrsWithIndex PAWI; | 321 llvm::ParamAttrsWithIndex PAWI; |
322 | 322 |
323 // set zext/sext attr on return value if necessary | 323 // set return value attrs if any |
324 if (f->next->isintegral() && f->next->size() < PTRSIZE) | 324 if (f->llvmRetAttrs) |
325 { | 325 { |
326 PAWI.Index = 0; | 326 PAWI.Index = 0; |
327 if (f->next->isunsigned()) | 327 PAWI.Attrs = f->llvmRetAttrs; |
328 PAWI.Attrs = llvm::ParamAttr::ZExt; | |
329 else | |
330 PAWI.Attrs = llvm::ParamAttr::SExt; | |
331 attrs.push_back(PAWI); | 328 attrs.push_back(PAWI); |
332 } | 329 } |
333 | 330 |
334 // set byval attrs on implicit main arg | 331 // set byval attrs on implicit main arg |
335 if (fdecl->isMain() && Argument::dim(f->parameters) == 0) | 332 if (fdecl->isMain() && Argument::dim(f->parameters) == 0) |