This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Remove OutputSectionFactory::lookup method
AbandonedPublic

Authored by grimar on Apr 14 2016, 6:25 AM.

Details

Reviewers
ruiu
rafael
Summary

What about removing OutputSectionFactory::lookup method ?
It is single line and IMO removing will decrease amount
of code without visible hurt.

Diff Detail

Event Timeline

grimar updated this revision to Diff 53701.Apr 14 2016, 6:25 AM
grimar retitled this revision from to [ELF] - Remove OutputSectionFactory::lookup method.
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar.
rafael edited edge metadata.Apr 14 2016, 6:55 AM
rafael added a subscriber: rafael.

How about just defining it inline?

One of the annoyances of the Map interface is the just using [] adds
an entry. Having the Map be private means we only have to look at a
few places to know that we don't accidentally create entries when we
don't want to: the two visible methods are named create and lookup.

Cheers,
Rafael

How about just defining it inline?

One of the annoyances of the Map interface is the just using [] adds
an entry. Having the Map be private means we only have to look at a
few places to know that we don't accidentally create entries when we
don't want to: the two visible methods are named create and lookup.

Cheers,
Rafael

Ok. Motivation to keep it private under guard of method call was clear,
I just assumed we will not use [] to have that effect :)

grimar abandoned this revision.Apr 14 2016, 7:13 AM

Made it inline in r266304.

ruiu edited edge metadata.Apr 14 2016, 9:50 AM

By "inline", I think it means moving the definition of the function into the class definition, instead of inlining function definition to the places where the function is used.

In D19111#401398, @ruiu wrote:

By "inline", I think it means moving the definition of the function into the class definition, instead of inlining function definition to the places where the function is used.

That what was done in r266304. Current patch abandoned.