mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 11:28:05 +02:00
ac: fix build with LLVM 5.0svn
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
6e2b9fd071
commit
84012262ea
1 changed files with 8 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue