mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-26 08:33:14 +01:00
Attribute holds no longer multiple values in LLVM 3.3.
The solution is to replace Attribute with AttrBuilder in IrFuncTyArg. Then the argument attributes can be easily manipulated and transformed into the final AttributeSet.
This commit is contained in:
@@ -18,21 +18,20 @@
|
||||
#include "gen/tollvm.h"
|
||||
|
||||
#if LDC_LLVM_VER >= 303
|
||||
IrFuncTyArg::IrFuncTyArg(Type* t, bool bref, llvm::Attribute a) : type(t)
|
||||
IrFuncTyArg::IrFuncTyArg(Type* t, bool bref, llvm::AttrBuilder a)
|
||||
#else
|
||||
IrFuncTyArg::IrFuncTyArg(Type* t, bool bref, llvm::Attributes a) : type(t)
|
||||
IrFuncTyArg::IrFuncTyArg(Type* t, bool bref, llvm::Attributes a)
|
||||
#endif
|
||||
: type(t),
|
||||
ltype(t != Type::tvoid && bref ? DtoType(t->pointerTo()) : DtoType(t)),
|
||||
attrs(a), byref(bref), rewrite(0)
|
||||
{
|
||||
ltype = t != Type::tvoid && bref ? DtoType(t->pointerTo()) : DtoType(t);
|
||||
attrs = a;
|
||||
byref = bref;
|
||||
rewrite = NULL;
|
||||
}
|
||||
|
||||
#if LDC_LLVM_VER >= 303
|
||||
bool IrFuncTyArg::isInReg() const { return attrs.hasAttribute(llvm::Attribute::InReg); }
|
||||
bool IrFuncTyArg::isSRet() const { return attrs.hasAttribute(llvm::Attribute::StructRet); }
|
||||
bool IrFuncTyArg::isByVal() const { return attrs.hasAttribute(llvm::Attribute::ByVal); }
|
||||
bool IrFuncTyArg::isInReg() const { return attrs.contains(llvm::Attribute::InReg); }
|
||||
bool IrFuncTyArg::isSRet() const { return attrs.contains(llvm::Attribute::StructRet); }
|
||||
bool IrFuncTyArg::isByVal() const { return attrs.contains(llvm::Attribute::ByVal); }
|
||||
#elif LDC_LLVM_VER == 302
|
||||
bool IrFuncTyArg::isInReg() const { return attrs.hasAttribute(llvm::Attributes::InReg); }
|
||||
bool IrFuncTyArg::isSRet() const { return attrs.hasAttribute(llvm::Attributes::StructRet); }
|
||||
|
||||
Reference in New Issue
Block a user