This is an archive of the discontinued LLVM Phabricator instance.

Replace GAlloc with a template function.
Needs ReviewPublic

Authored by ruiu on Oct 27 2016, 12:58 PM.
This revision needs review, but all specified reviewers are disabled or inactive.

Details

Reviewers
espindola
Summary

This patch replaces GAlloc<ELFT>::<sometype>.Allocate() with
alloc<sometype<ELFT>>().

Event Timeline

ruiu updated this revision to Diff 76086.Oct 27 2016, 12:58 PM
ruiu retitled this revision from to Replace GAlloc with a template function..
ruiu updated this object.
ruiu added a reviewer: rafael.
ruiu added a subscriber: llvm-commits.
ruiu updated this revision to Diff 76097.Oct 27 2016, 2:03 PM
  • also manage InputFile::Pool with the arena allocator.
ruiu updated this revision to Diff 76098.Oct 27 2016, 2:05 PM
  • remove InputFile's virtual dtor.
rafael accepted this revision.Oct 28 2016, 7:49 AM
rafael edited edge metadata.

LGTM with nit

ELF/Memory.cpp
23

Do we still need to free this at a specific point in time? If not just letting the destructors take care of it should simplify the code.

This revision is now accepted and ready to land.Oct 28 2016, 7:49 AM
ruiu added inline comments.Oct 28 2016, 3:22 PM
ELF/Memory.cpp
23

This is for the use case in which you directly call lld::elf::link from your program. In that use case, we want to free all memories before returning from link().

espindola edited reviewers, added: espindola; removed: rafael.Mar 14 2018, 4:53 PM
This revision now requires review to proceed.Mar 14 2018, 4:53 PM