Mesa (master): ac: fix build with LLVM 5.0svn
Marek Olšák
mareko at kemper.freedesktop.org
Wed Mar 22 16:55:41 UTC 2017
Module: Mesa
Branch: master
Commit: 84012262ea70435507d3b88ddbc0f621781ec275
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=84012262ea70435507d3b88ddbc0f621781ec275
Author: Marek Olšák <marek.olsak at amd.com>
Date: Tue Mar 21 23:15:05 2017 +0100
ac: fix build with LLVM 5.0svn
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
Reviewed-by: Dave Airlie <airlied at redhat.com>
---
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 4f03103561..d9ea4b162e 100644
--- a/src/amd/common/ac_llvm_helper.cpp
+++ b/src/amd/common/ac_llvm_helper.cpp
@@ -35,18 +35,24 @@
#include <llvm/ExecutionEngine/ExecutionEngine.h>
#include <llvm/IR/Attributes.h>
+#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<llvm::Argument>(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<llvm::Argument>(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);
More information about the mesa-commit
mailing list