From 84012262ea70435507d3b88ddbc0f621781ec275 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 21 Mar 2017 23:15:05 +0100 Subject: [PATCH] ac: fix build with LLVM 5.0svn MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle Reviewed-by: Dave Airlie --- src/amd/common/ac_llvm_helper.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/amd/common/ac_llvm_helper.cpp b/src/amd/common/ac_llvm_helper.cpp index 4f03103..d9ea4b1 100644 --- a/src/amd/common/ac_llvm_helper.cpp +++ b/src/amd/common/ac_llvm_helper.cpp @@ -35,18 +35,24 @@ #include #include +#if HAVE_LLVM < 0x0500 +namespace llvm { +typedef AttributeSet AttributeList; +} +#endif + void ac_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes) { llvm::Argument *A = llvm::unwrap(val); llvm::AttrBuilder B; B.addDereferenceableAttr(bytes); - A->addAttr(llvm::AttributeSet::get(A->getContext(), A->getArgNo() + 1, B)); + A->addAttr(llvm::AttributeList::get(A->getContext(), A->getArgNo() + 1, B)); } bool ac_is_sgpr_param(LLVMValueRef arg) { llvm::Argument *A = llvm::unwrap(arg); - llvm::AttributeSet AS = A->getParent()->getAttributes(); + llvm::AttributeList AS = A->getParent()->getAttributes(); unsigned ArgNo = A->getArgNo(); return AS.hasAttribute(ArgNo + 1, llvm::Attribute::ByVal) || AS.hasAttribute(ArgNo + 1, llvm::Attribute::InReg); -- 2.7.4