mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-07 11:26:02 +03:00
Pass IrFunction* to applyFuncDeclUDAs instead of irfunc->func (llvm::Function*) such that LDC's UDAs can set function properties that are not part of llvm::Function.
This commit is contained in:
parent
339d875327
commit
b25b7966cc
3 changed files with 8 additions and 4 deletions
|
@ -496,7 +496,7 @@ void DtoDeclareFunction(FuncDeclaration *fdecl) {
|
|||
}
|
||||
}
|
||||
|
||||
applyFuncDeclUDAs(fdecl, func);
|
||||
applyFuncDeclUDAs(fdecl, irFunc);
|
||||
|
||||
// main
|
||||
if (fdecl->isMain()) {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "attrib.h"
|
||||
#include "declaration.h"
|
||||
#include "expression.h"
|
||||
#include "ir/irfunction.h"
|
||||
#include "module.h"
|
||||
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
|
@ -211,10 +212,13 @@ void applyVarDeclUDAs(VarDeclaration *decl, llvm::GlobalVariable *gvar) {
|
|||
}
|
||||
}
|
||||
|
||||
void applyFuncDeclUDAs(FuncDeclaration *decl, llvm::Function *func) {
|
||||
void applyFuncDeclUDAs(FuncDeclaration *decl, IrFunction *irFunc) {
|
||||
if (!decl->userAttribDecl)
|
||||
return;
|
||||
|
||||
llvm::Function *func = irFunc->func;
|
||||
assert(func);
|
||||
|
||||
Expressions *attrs = decl->userAttribDecl->getAttributes();
|
||||
expandTuples(attrs);
|
||||
for (auto &attr : *attrs) {
|
||||
|
|
|
@ -18,12 +18,12 @@
|
|||
class Dsymbol;
|
||||
class FuncDeclaration;
|
||||
class VarDeclaration;
|
||||
struct IrFunction;
|
||||
namespace llvm {
|
||||
class Function;
|
||||
class GlobalVariable;
|
||||
}
|
||||
|
||||
void applyFuncDeclUDAs(FuncDeclaration *decl, llvm::Function *func);
|
||||
void applyFuncDeclUDAs(FuncDeclaration *decl, IrFunction *irFunc);
|
||||
void applyVarDeclUDAs(VarDeclaration *decl, llvm::GlobalVariable *gvar);
|
||||
|
||||
bool hasWeakUDA(Dsymbol *sym);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue