[PATCH] Move DWARFUnitSection from inheriting SmallVector to holding an instance.

David Blaikie dblaikie at gmail.com
Mon Sep 15 12:30:16 PDT 2014


On Mon, Sep 15, 2014 at 11:15 AM, Frederic Riss <friss at apple.com> wrote:

> As it is explained in the commit log, this patch only moves from
> inheritance to composition, and the goal is to design a new interface
> better suited to DWARFUnitSection. This step is arguably what I should have
> posted first, the inheritance step wasn't really necessary. Now I could
> modify a lot more things in one go, but I usually get asked to split
> functional steps more not less :-)
>

The changes Alexey suggested could possibly be done before this one (&
before the inheritance was added too) - just as simple cleanup patches.
Cleanup patches are nice & easy to review (& certainly just turning a loop
into a range-based-for loop is the sort of thing that's commonly handled in
post-commit review). By staging those cleanups ahead of this change, you
wouldn't have to introduce and then remove a bunch of this API - it'd just
never be needed.

This is what I do with some of the unique_ptr cleanup - by changing APIs
taking non-owning T* to take T& initially as a simple cleanup, then when I
change to unique_ptr the call sites like "func(*ptr)" remain untouched when
ptr changes from raw to unique_ptr (without this I'd have had to change
each call site from "func(ptr)" to "func(ptr.get())").

- David


>
> http://reviews.llvm.org/D5352
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140915/7eb0edca/attachment.html>


More information about the llvm-commits mailing list