[Mesa-dev] [PATCH] clover: fix llvm 3.5 build error
Zoltan Gilian
zoltan.gilian at gmail.com
Tue Aug 4 13:40:04 PDT 2015
There is no MDOperand in llvm 3.5.
---
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);
--
2.4.6
More information about the mesa-dev
mailing list