ac: fix build with LLVM 5.0svn
authorMarek Olšák <marek.olsak@amd.com>
Tue, 21 Mar 2017 22:15:05 +0000 (23:15 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 22 Mar 2017 16:54:42 +0000 (17:54 +0100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_llvm_helper.cpp

index 4f03103561e30ea5f5e05b8f11c1de0db76256ee..d9ea4b162e90d91bc1ac0c67a24c4dbfb39f9f72 100644 (file)
 #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);