From: Greg V Date: Wed, 4 Jul 2018 17:15:04 +0000 (+0300) Subject: clover: use iterator_range in get_kernel_nodes X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6da865bcfeecaa9ab4bb1632416d813f7df24f3e;p=mesa.git clover: use iterator_range in get_kernel_nodes With libc++ (LLVM's STL implementation), the original code does not compile because an appropriate vector constructor cannot be found (for the _ForwardIterator one, requirement is_constructible is not satisfied). --- diff --git a/src/gallium/state_trackers/clover/llvm/metadata.hpp b/src/gallium/state_trackers/clover/llvm/metadata.hpp index d23f317c0a5..b2f3e5d95b2 100644 --- a/src/gallium/state_trackers/clover/llvm/metadata.hpp +++ b/src/gallium/state_trackers/clover/llvm/metadata.hpp @@ -39,11 +39,11 @@ namespace clover { namespace llvm { namespace detail { - inline std::vector + inline iterator_range< ::llvm::NamedMDNode::const_op_iterator> get_kernel_nodes(const ::llvm::Module &mod) { if (const ::llvm::NamedMDNode *n = mod.getNamedMetadata("opencl.kernels")) - return { n->op_begin(), n->op_end() }; + return range(n->op_begin(), n->op_end()); else return {}; }