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:
kai
2013-02-03 15:09:36 +01:00
parent 0ff8d2f9f1
commit f806ec0ed5
6 changed files with 58 additions and 46 deletions

View File

@@ -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); }