Re: [Mesa-dev] [PATCH v2] ac: fix build after LLVM 5.0 SVN r300718

2017-04-20 Thread Mike Lothian
Thanks for this

Tested-and-reviewed-by: Mike Lothian 

On Thu, 20 Apr 2017 at 09:48 Nicolai Hähnle  wrote:

> On 20.04.2017 10:34, Christoph Haag wrote:
> > v2: previously getWithDereferenceableBytes() exists, but addAttr()
> doesn't take that type
> >
> > Signed-off-by: Christoph Haag 
>
> Reviewed-by: Nicolai Hähnle 
>
>
> > ---
> >  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 d9ea4b162e..11fa80920d 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)
> >
>
>
> --
> Lerne, wie die Welt wirklich ist,
> Aber vergiss niemals, wie sie sein sollte.
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2] ac: fix build after LLVM 5.0 SVN r300718

2017-04-20 Thread Nicolai Hähnle

On 20.04.2017 10:34, Christoph Haag wrote:

v2: previously getWithDereferenceableBytes() exists, but addAttr() doesn't take 
that type

Signed-off-by: Christoph Haag 


Reviewed-by: Nicolai Hähnle 



---
 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 d9ea4b162e..11fa80920d 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)




--
Lerne, wie die Welt wirklich ist,
Aber vergiss niemals, wie sie sein sollte.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev