<div dir="ltr">Seems pretty plausible to me - my only question would be whether it's worth the churn to do this intermediate step before finishing off typeless pointers (granted, I've stalled out on that for nearly a year, admittedly - but good to have extra hands/incentives - there's still a fair bit of work to do though, so understandable if it might not be useful to block progress on other things to finish it off) - not sure how much work this would produce as an intermediate step compared to progress towards the end goal directly. Perhaps not much.<br><br>- Dave</div><br><div class="gmail_quote"><div dir="ltr">On Sat, Oct 29, 2016 at 8:41 PM Peter Collingbourne via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Hi all,<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">An oddity that has existed for a long time in the IR is that PointerType derives from SequentialType. Per subject I propose to make PointerType derive from Type for a couple of reasons:</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">- Values of type PointerType are unlike the other SequentialTypes (arrays and vectors) in that they do not hold values of the element type. By moving PointerType we can unify certain aspects of how the other SequentialTypes are handled.</div><div class="gmail_msg">- PointerType will have no place in the SequentialType hierarchy once pointee types are removed, so this is a necessary step towards removing pointee types.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Although this would slightly complicate GEP enumeration, this can be handled at the API level and is also inevitable given the move to remove pointee types.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Specifically I want to change the API exposed by the GEP type iterator so that each iterator can be in one of three states: unbounded array (i.e. the existing PointerType state, which would represent the first "element" of the GEP), bounded array (the existing ArrayType state) or struct (the existing StructType state). In the former two cases clients would not have access to the "underlying" type and would only be able to access the "boundedness", the upper bound if any and the element type.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Thanks,<br class="gmail_msg">-- <br class="gmail_msg"><div class="m_-360905677813911331gmail_signature gmail_msg"><div dir="ltr" class="gmail_msg">-- <div class="gmail_msg">Peter</div></div></div>
</div></div>
_______________________________________________<br class="gmail_msg">
LLVM Developers mailing list<br class="gmail_msg">
<a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="gmail_msg">
</blockquote></div>