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

Greg Clayton via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 10 18:01:16 PST 2016


It can be NULL so it needs to stay a pointer. An upcoming change will call DWARFFormValue::getFixedByteSize() for each form in an abbreviation with a NULL DWARFUnit and expect to get None back for anything that can change size due to version, addrsize or DWARF32/DWARF64.

> On Nov 10, 2016, at 4:27 PM, David Blaikie <dblaikie at gmail.com> wrote:
> 
> Sure - still feels a bit like overengineering, but anyway.
> 
> The parameter should be const ref, rather than pointer (it can't be null, so prefer a reference) & the template parameter type could perhaps have a more meaningful name like 'FormSizes' or somesuch.
> 
> On Thu, Nov 10, 2016 at 4:06 PM Greg Clayton <clayborg at gmail.com> wrote:
> David,
> 
> Take a look at the latest changes I posted. I think this will solve the issues we were both worried about.
> 
> https://reviews.llvm.org/D26526
> 
> Let me know what you think.
> 
> Greg
> 
> 
> 
> > On Nov 10, 2016, at 3:39 PM, David Blaikie <dblaikie at gmail.com> wrote:
> >
> >
> >
> > 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
> 



More information about the llvm-commits mailing list