From a9d27c8a33a4aef9b71f716cd08ad3d52bc1591c Mon Sep 17 00:00:00 2001 From: Christoph Haag Date: Thu, 20 Apr 2017 10:34:18 +0200 Subject: [PATCH] ac: fix build after LLVM 5.0 SVN r300718 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit v2: previously getWithDereferenceableBytes() exists, but addAttr() doesn't take that type Signed-off-by: Christoph Haag Reviewed-by: Nicolai Hähnle Tested-and-reviewed-by: Mike Lothian --- src/amd/common/ac_llvm_helper.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/amd/common/ac_llvm_helper.cpp b/src/amd/common/ac_llvm_helper.cpp index d9ea4b1..11fa809 100644 --- a/src/amd/common/ac_llvm_helper.cpp +++ b/src/amd/common/ac_llvm_helper.cpp @@ -44,9 +44,13 @@ typedef AttributeSet AttributeList; void ac_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes) { llvm::Argument *A = llvm::unwrap(val); +#if HAVE_LLVM < 0x0500 llvm::AttrBuilder B; B.addDereferenceableAttr(bytes); A->addAttr(llvm::AttributeList::get(A->getContext(), A->getArgNo() + 1, B)); +#else + A->addAttr(llvm::Attribute::getWithDereferenceableBytes(A->getContext(), bytes)); +#endif } bool ac_is_sgpr_param(LLVMValueRef arg) -- 2.7.4