[llvm-dev] [broken rL203058] llvm/IR/Metadata.h NamedMDNode iterator broke Mesa with libcxx (original) (raw)

Martin Pelikán via llvm-dev llvm-dev at lists.llvm.org
Sun Apr 16 02:54:33 PDT 2017


Hi,

I've been unable to compile Mesa on my Gentoo box with LLVM and libcxx for some time, and only now got the time to hunt down the bug:

TL;DR: rL203058 mentions your review which isn't linked in Phabricator, and it makes NamedMDNode's iterator template<T1,T2> for a reason unknown to me. This breaks Mesa which wants to use this iterator to construct vector<const MDNode *> from {op_begin, op_end}.

If you believe this is Mesa's fault, I'd like to know why (and why does LLVM bother exporting an std::iterator if people aren't supposed to use it).

See the following URLs for the interaction:

https://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/state_trackers/clover/llvm/metadata.hpp#n41 https://github.com/llvm-mirror/llvm/blob/master/include/llvm/IR/Metadata.h#L1293

Facts:

What I want to know is why did you introduce T2 only to pass it into the parent std::iterator<> class and not anywhere else. Changing the inheritance to "T1 = const MDNode*" makes it all work again.

Thanks!

Martin Pelikan



More information about the llvm-dev mailing list