[Mesa-dev] [PATCH] clover: fix llvm 3.5 build error
Jan Vesely
jan.vesely at rutgers.edu
Tue Aug 4 20:21:31 PDT 2015
On Tue, 2015-08-04 at 22:40 +0200, Zoltan Gilian wrote:
> There is no MDOperand in llvm 3.5.
thanks, this fixes the build for me.
jan
> ---
> src/gallium/state_trackers/clover/llvm/invocation.cpp | 19 ++++++++++---------
> 1 file changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> index 50c4557..cc2c421 100644
> --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
> +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> @@ -371,12 +371,13 @@ namespace {
> return kernel_node;
> }
>
> - llvm::MDNode*
> - node_from_op_checked(const llvm::MDOperand &md_operand,
> - llvm::StringRef expect_name,
> - unsigned expect_num_args)
> + const llvm::MDNode *
> + get_operand_checked(const llvm::MDNode *parent,
> + const unsigned op_idx,
> + const llvm::StringRef expect_name,
> + const unsigned expect_num_args)
> {
> - auto node = llvm::cast<llvm::MDNode>(md_operand);
> + auto node = llvm::cast<llvm::MDNode>(parent->getOperand(op_idx));
> assert(node->getNumOperands() == expect_num_args &&
> "Wrong number of operands.");
>
> @@ -399,10 +400,10 @@ namespace {
> auto num_args = kernel_func->getArgumentList().size();
>
> auto kernel_node = get_kernel_metadata(kernel_func);
> - auto aq = node_from_op_checked(kernel_node->getOperand(2),
> - "kernel_arg_access_qual", num_args + 1);
> - auto ty = node_from_op_checked(kernel_node->getOperand(3),
> - "kernel_arg_type", num_args + 1);
> + auto aq = get_operand_checked(kernel_node, 2, "kernel_arg_access_qual",
> + num_args + 1);
> + auto ty = get_operand_checked(kernel_node, 3, "kernel_arg_type",
> + num_args + 1);
>
> std::vector<kernel_arg_md> res;
> res.reserve(num_args);
--
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150804/888c7d8f/attachment-0001.sig>
More information about the mesa-dev
mailing list