[PATCH] D26526: Clean up DWARFFormValue by reducing duplicated code and removing DWARFFormValue::getFixedFormSizes()

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 10 15:39:08 PST 2016


On Thu, Nov 10, 2016 at 3:34 PM Greg Clayton <clayborg at gmail.com> wrote:

> clayborg added a comment.
>
> In order to skip a form to access the 10th attribute, we need to skip 9
> forms. Each one of those will individually extract 3 piece of data for
> which 2 surely never be used and 1 might be used 10% of the time. So it
> seems it would be worth being lazy if we can especially since it is so easy
> to do.
>

Still just seems a bit premature to me - you'll still have to initialize
the vptr every time through there, for example, and when you do access it
it'll be dynamic calls and all that.

In order of preference:

1) just punt on the whole thing & gather the three values up-front
2) make it a template (if performance is this important here - let's avoid
the virtual calls, even if it's on relatively few forms)
3) as-is, except with the dtor non-virtual (protected in the base class,
derived classes final)

I'll leave it to you & Adrian, though - just my 2c.

- Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161110/917fb7fa/attachment.html>


More information about the llvm-commits mailing list