<div dir="ltr">I put it up for review.  I don't expect anyone to actually review it since it's quite large and 99% of it is the same exact thing.  I'm running tests on Linux and Windows right now.  Will also test on Mac if beanz's new lldb framework thing works out for me.  I'm going to try to commit sometime after lunch after I confirm all the tests are passing.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Sep 22, 2016 at 9:33 AM Greg Clayton <<a href="mailto:gclayton@apple.com">gclayton@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">That sounds like a good patch. I look forward to seeing it.<br class="gmail_msg">
<br class="gmail_msg">
> On Sep 21, 2016, at 11:48 PM, Zachary Turner via lldb-dev <<a href="mailto:lldb-dev@lists.llvm.org" class="gmail_msg" target="_blank">lldb-dev@lists.llvm.org</a>> wrote:<br class="gmail_msg">
><br class="gmail_msg">
> I have a patch I'd like to submit tomorrow which converts all of the global command option tables from C-style arrays to llvm ArrayRefs.<br class="gmail_msg">
><br class="gmail_msg">
> Actually they are still declared internally in each translation unit as C-style arrays, but the Option classes are updated so that they return ArrayRefs instead of raw pointers.  Previously there were two strategies:<br class="gmail_msg">
><br class="gmail_msg">
> 1) Sometimes we'd return a const Option* and have a method on the class called GetNumDefinitions() so you could treat the pointer as an array.<br class="gmail_msg">
><br class="gmail_msg">
> 2) Other times we'd return a const Option* and expect the caller to iterate until it reached a sentinel entry.<br class="gmail_msg">
><br class="gmail_msg">
> With the new approach, the two methods are merged and now the GetDefinitions() method only returns an ArrayRef<OptionDefinition>.<br class="gmail_msg">
><br class="gmail_msg">
> Since this carries with it its length, neither the GetNumDefinitions() method nor the sentinel entry are needed any more.<br class="gmail_msg">
><br class="gmail_msg">
> Most of the old code compiled without modification, because ArrayRef can be treated with a similar syntax as arrays, except you'll get a nice assert if you index out of bounds.<br class="gmail_msg">
><br class="gmail_msg">
> An added bonus is that you can now iterate over them with ranged-based for syntax.<br class="gmail_msg">
><br class="gmail_msg">
> I can put it up for review if anyone would like, but as it is extremely mechanical there's not really much to see.<br class="gmail_msg">
> _______________________________________________<br class="gmail_msg">
> lldb-dev mailing list<br class="gmail_msg">
> <a href="mailto:lldb-dev@lists.llvm.org" class="gmail_msg" target="_blank">lldb-dev@lists.llvm.org</a><br class="gmail_msg">
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev</a><br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div>