diff --git a/src/tcompiler.cpp b/src/tcompiler.cpp index db50fce10..7af3a3916 100644 --- a/src/tcompiler.cpp +++ b/src/tcompiler.cpp @@ -958,12 +958,20 @@ struct CCallingConv { template void addSRetAttr(FnOrCall *r, int idx, Type* ty) { +#if LLVM_VERSION < 120 + r->addAttribute(idx, Attribute::SRet); +#else r->addAttribute(idx, Attribute::getWithStructRetType(*CU->TT->ctx, ty)); +#endif r->addAttribute(idx, Attribute::NoAlias); } template void addByValAttr(FnOrCall *r, int idx, Type* ty) { +#if LLVM_VERSION < 120 + r->addAttribute(idx, llvm::Attribute::ByVal); +#else r->addAttribute(idx, llvm::Attribute::getWithByValType(*CU->TT->ctx, ty)); +#endif } template void addExtAttrIfNeeded(TType *t, FnOrCall *r, int idx) {