This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Split struct In<ELFT> to have templated and non-templated sections areas.
ClosedPublic

Authored by grimar on Mar 14 2017, 7:16 AM.

Details

Summary

Patch splits In<ELFT> into 2 classes: one for non-templated sections,
second contains ELFT templated ones.
That allows to code that was detemplated to access non-templated sections freely,
and should open road for futher detemplation proccess.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Mar 14 2017, 7:16 AM

Probably deriving In<ELFT> from non-templated structure would be easier?

template <class ELFT> struct In : InBase { .... };
ruiu edited edge metadata.Mar 14 2017, 10:21 AM

This removes template parameter from only three sections among 27 sections, and now you have to append X everywhere. Is this really worth it? I wonder if we should just wait for C++14 template variable.

In D30939#700740, @ruiu wrote:

This removes template parameter from only three sections among 27 sections, and now you have to append X everywhere. Is this really worth it? I wonder if we should just wait for C++14 template variable.

After today there are 13 such sections. The approach of splitting In structure is itself very usefull. I showed that in D30982.
I applied @evgeny777 suggestion to have base and derived class to reduce amount of changes required.

grimar updated this revision to Diff 91874.Mar 15 2017, 7:38 AM
grimar edited the summary of this revision. (Show Details)
  • Updated in according to Evgeny suggestion, also used in D30982.
This revision was automatically updated to reflect the committed changes.