mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
AttributeSet::get(... AttributeWithIndex ...) is now private.
AttributeWithIndex is really going away in LLVM 3.3. This is a horrible hack to keep everything compiling. Attribute handling needs some rework.
This commit is contained in:
@@ -648,8 +648,14 @@ static void set_param_attrs(TypeFunction* f, llvm::Function* func, FuncDeclarati
|
||||
}
|
||||
|
||||
#if LDC_LLVM_VER >= 303
|
||||
llvm::AttributeSet attrlist = llvm::AttributeSet::get(gIR->context(),
|
||||
llvm::ArrayRef<llvm::AttributeWithIndex>(attrs));
|
||||
// FIXME: This is horrible inefficient. The real fix is to use AttributeSet
|
||||
// right from the beginning.
|
||||
llvm::AttributeSet attrlist;
|
||||
for (llvm::SmallVector<llvm::AttributeWithIndex, 9>::iterator I = attrs.begin(), E = attrs.end(); I != E; ++I)
|
||||
{
|
||||
llvm::AttributeSet tmp = llvm::AttributeSet::get(gIR->context(), (*I).Index, llvm::AttrBuilder().addAttributes((*I).Attrs));
|
||||
attrlist = attrlist.addAttributes(gIR->context(), (*I).Index, tmp);
|
||||
}
|
||||
#elif LDC_LLVM_VER >= 302
|
||||
llvm::AttrListPtr attrlist = llvm::AttrListPtr::get(gIR->context(),
|
||||
llvm::ArrayRef<llvm::AttributeWithIndex>(attrs));
|
||||
|
||||
@@ -752,8 +752,14 @@ DValue* DtoCallFunction(Loc& loc, Type* resulttype, DValue* fnval, Expressions*
|
||||
|
||||
// set calling convention and parameter attributes
|
||||
#if LDC_LLVM_VER >= 303
|
||||
llvm::AttributeSet attrlist = llvm::AttributeSet::get(gIR->context(),
|
||||
llvm::ArrayRef<llvm::AttributeWithIndex>(attrs));
|
||||
// FIXME: This is horrible inefficient. The real fix is to use AttributeSet
|
||||
// right from the beginning.
|
||||
llvm::AttributeSet attrlist;
|
||||
for (std::vector<llvm::AttributeWithIndex>::iterator I = attrs.begin(), E = attrs.end(); I != E; ++I)
|
||||
{
|
||||
llvm::AttributeSet tmp = llvm::AttributeSet::get(gIR->context(), (*I).Index, llvm::AttrBuilder().addAttributes((*I).Attrs));
|
||||
attrlist = attrlist.addAttributes(gIR->context(), (*I).Index, tmp);
|
||||
}
|
||||
#elif LDC_LLVM_VER == 302
|
||||
llvm::AttrListPtr attrlist = llvm::AttrListPtr::get(gIR->context(),
|
||||
llvm::ArrayRef<llvm::AttributeWithIndex>(attrs));
|
||||
|
||||
Reference in New Issue
Block a user