This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Linkerscript: do not use outputsections factory.
AbandonedPublic

Authored by grimar on Aug 25 2016, 1:39 AM.

Details

Reviewers
ruiu
Summary

As was requested in comments for D23603,
this patch removes using of Factory from linkerscript,

Next step after this can be stop exporting the factory from
writer.cpp.

Diff Detail

Event Timeline

grimar updated this revision to Diff 69204.Aug 25 2016, 1:39 AM
grimar retitled this revision from to [ELF] - Linkerscript: do not use outputsections factory..
grimar updated this object.
grimar added a reviewer: ruiu.
grimar added subscribers: llvm-commits, grimar, davide, evgeny777.
grimar updated this revision to Diff 69207.Aug 25 2016, 1:42 AM
  • Simplified.
grimar updated this revision to Diff 69210.Aug 25 2016, 1:50 AM
  • Simplified more.
  • Removed unintended changes.
grimar updated this revision to Diff 69211.Aug 25 2016, 2:06 AM
  • Simplify even more (previous diff contained changes for easy integration of code to merge section attributes when combining them, but

since this patch just about removing the dependency on section factory, this changes are unnessecary for now, so I removed them what allowed to simplify a bit more).

ruiu added inline comments.Aug 29 2016, 2:32 PM
ELF/LinkerScript.cpp
28

This can be a non-member function now, I guess?

32

Move the variable definition closer to the first use of the variable.

33

Remove {}

ELF/LinkerScript.h
1

Use Out<ELFT>::Pool instead.

ELF/OutputSections.cpp
19

Remove this variable and use early returns.

grimar updated this revision to Diff 69655.Aug 30 2016, 2:32 AM
  • Addressed review comments.
ELF/LinkerScript.cpp
28

Yep, done.

32

Done.

33

I can't :( This is neccesary for VS2015, otherwise it shows:

error C2143: syntax error: missing ';' before '}'

ELF/LinkerScript.h
1

Done.

ELF/OutputSections.cpp
19

Done.

grimar abandoned this revision.Aug 31 2016, 5:33 AM

If we are going with multiple output sections for single declaration, this one is no more actual.