summaryrefslogtreecommitdiffstats
path: root/src/amd/common
diff options
context:
space:
mode:
authorChristoph Haag <[email protected]>2017-04-20 10:34:18 +0200
committerNicolai Hähnle <[email protected]>2017-04-20 10:58:19 +0200
commita9d27c8a33a4aef9b71f716cd08ad3d52bc1591c (patch)
tree666cbf590e8fea66c594438dcce3026cc91efe97 /src/amd/common
parent3af7f8275b806d42daaad6f700c3917f8e33d3e4 (diff)
ac: fix build after LLVM 5.0 SVN r300718
v2: previously getWithDereferenceableBytes() exists, but addAttr() doesn't take that type Signed-off-by: Christoph Haag <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Tested-and-reviewed-by: Mike Lothian <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r--src/amd/common/ac_llvm_helper.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/amd/common/ac_llvm_helper.cpp b/src/amd/common/ac_llvm_helper.cpp
index d9ea4b162e9..11fa80920d6 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<llvm::Argument>(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)