mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-12 05:47:11 +03:00
AttrListPtr is renamed to AttributeSet in LLVM 3.3.
This commit is contained in:
parent
b92c461147
commit
1a06130cfa
4 changed files with 20 additions and 2 deletions
|
@ -567,7 +567,11 @@ static void set_param_attrs(TypeFunction* f, llvm::Function* func, FuncDeclarati
|
||||||
// Merge in any old attributes (attributes for the function itself are
|
// Merge in any old attributes (attributes for the function itself are
|
||||||
// also stored in a list slot).
|
// also stored in a list slot).
|
||||||
const size_t newSize = attrs.size();
|
const size_t newSize = attrs.size();
|
||||||
|
#if LDC_LLVM_VER >= 303
|
||||||
|
llvm::AttributeSet oldAttrs = func->getAttributes();
|
||||||
|
#else
|
||||||
llvm::AttrListPtr oldAttrs = func->getAttributes();
|
llvm::AttrListPtr oldAttrs = func->getAttributes();
|
||||||
|
#endif
|
||||||
for (size_t i = 0; i < oldAttrs.getNumSlots(); ++i) {
|
for (size_t i = 0; i < oldAttrs.getNumSlots(); ++i) {
|
||||||
llvm::AttributeWithIndex curr = oldAttrs.getSlot(i);
|
llvm::AttributeWithIndex curr = oldAttrs.getSlot(i);
|
||||||
|
|
||||||
|
@ -591,7 +595,10 @@ static void set_param_attrs(TypeFunction* f, llvm::Function* func, FuncDeclarati
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LDC_LLVM_VER >= 302
|
#if LDC_LLVM_VER >= 303
|
||||||
|
llvm::AttributeSet attrlist = llvm::AttributeSet::get(gIR->context(),
|
||||||
|
llvm::ArrayRef<llvm::AttributeWithIndex>(attrs));
|
||||||
|
#elif LDC_LLVM_VER >= 302
|
||||||
llvm::AttrListPtr attrlist = llvm::AttrListPtr::get(gIR->context(),
|
llvm::AttrListPtr attrlist = llvm::AttrListPtr::get(gIR->context(),
|
||||||
llvm::ArrayRef<llvm::AttributeWithIndex>(attrs));
|
llvm::ArrayRef<llvm::AttributeWithIndex>(attrs));
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -191,7 +191,11 @@ LLValue* DtoCallableValue(DValue* fn);
|
||||||
LLFunctionType* DtoExtractFunctionType(LLType* type);
|
LLFunctionType* DtoExtractFunctionType(LLType* type);
|
||||||
|
|
||||||
///
|
///
|
||||||
|
#if LDC_LLVM_VER >= 303
|
||||||
|
void DtoBuildDVarArgList(std::vector<LLValue*>& args, llvm::AttributeSet& palist, TypeFunction* tf, Expressions* arguments, size_t argidx);
|
||||||
|
#else
|
||||||
void DtoBuildDVarArgList(std::vector<LLValue*>& args, llvm::AttrListPtr& palist, TypeFunction* tf, Expressions* arguments, size_t argidx);
|
void DtoBuildDVarArgList(std::vector<LLValue*>& args, llvm::AttrListPtr& palist, TypeFunction* tf, Expressions* arguments, size_t argidx);
|
||||||
|
#endif
|
||||||
|
|
||||||
///
|
///
|
||||||
DValue* DtoCallFunction(Loc& loc, Type* resulttype, DValue* fnval, Expressions* arguments);
|
DValue* DtoCallFunction(Loc& loc, Type* resulttype, DValue* fnval, Expressions* arguments);
|
||||||
|
|
|
@ -220,7 +220,11 @@ static void LLVM_D_BuildRuntimeModule()
|
||||||
|
|
||||||
// Construct some attribute lists used below (possibly multiple times)
|
// Construct some attribute lists used below (possibly multiple times)
|
||||||
#if LDC_LLVM_VER >= 302
|
#if LDC_LLVM_VER >= 302
|
||||||
|
#if LDC_LLVM_VER >= 303
|
||||||
|
llvm::AttributeSet
|
||||||
|
#else
|
||||||
llvm::AttrListPtr
|
llvm::AttrListPtr
|
||||||
|
#endif
|
||||||
NoAttrs,
|
NoAttrs,
|
||||||
Attr_NoAlias
|
Attr_NoAlias
|
||||||
= NoAttrs.addAttr(gIR->context(), 0, llvm::Attributes::get(gIR->context(), llvm::AttrBuilder().addAttribute(llvm::Attributes::NoAlias))),
|
= NoAttrs.addAttr(gIR->context(), 0, llvm::Attributes::get(gIR->context(), llvm::AttrBuilder().addAttribute(llvm::Attributes::NoAlias))),
|
||||||
|
|
|
@ -717,7 +717,10 @@ DValue* DtoCallFunction(Loc& loc, Type* resulttype, DValue* fnval, Expressions*
|
||||||
}
|
}
|
||||||
|
|
||||||
// set calling convention and parameter attributes
|
// set calling convention and parameter attributes
|
||||||
#if LDC_LLVM_VER >= 302
|
#if LDC_LLVM_VER >= 303
|
||||||
|
llvm::AttributeSet attrlist = llvm::AttributeSet::get(gIR->context(),
|
||||||
|
llvm::ArrayRef<llvm::AttributeWithIndex>(attrs));
|
||||||
|
#elif LDC_LLVM_VER == 302
|
||||||
llvm::AttrListPtr attrlist = llvm::AttrListPtr::get(gIR->context(),
|
llvm::AttrListPtr attrlist = llvm::AttrListPtr::get(gIR->context(),
|
||||||
llvm::ArrayRef<llvm::AttributeWithIndex>(attrs));
|
llvm::ArrayRef<llvm::AttributeWithIndex>(attrs));
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue