Support generic ldc.attributes.llvmAttr UDAs for function parameters

This commit is contained in:
Martin Kinkelin 2019-03-31 19:25:20 +02:00
parent 1fdf330346
commit cc336d6df1
5 changed files with 96 additions and 51 deletions

View file

@ -603,6 +603,11 @@ void DtoDeclareFunction(FuncDeclaration *fdecl) {
// add func to IRFunc
irFunc->setLLVMFunc(func);
// First apply the TargetMachine attributes, such that they can be overridden
// by UDAs.
applyTargetMachineAttributes(*func, *gTargetMachine);
applyFuncDeclUDAs(fdecl, irFunc);
// parameter attributes
if (!DtoIsIntrinsic(fdecl)) {
applyParamAttrsToLLFunc(f, getIrFunc(fdecl)->irFty, func);
@ -611,11 +616,6 @@ void DtoDeclareFunction(FuncDeclaration *fdecl) {
}
}
// First apply the TargetMachine attributes, such that they can be overridden
// by UDAs.
applyTargetMachineAttributes(*func, *gTargetMachine);
applyFuncDeclUDAs(fdecl, irFunc);
if(irFunc->isDynamicCompiled()) {
declareDynamicCompiledFunction(gIR, irFunc);
}