[PATCH] D20433: [ELF] - Lazy initialization of MergeInputSection class internals.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Mon May 23 00:59:00 PDT 2016

grimar added a comment.

In http://reviews.llvm.org/D20433#436489, @ruiu wrote:

> You don't need to introduce a new notion of range for doing GC lazily. All you have to do is to memorize live offsets and apply it later. Please take a look at http://reviews.llvm.org/D20516

I am not doing GC lazily here. I think "memorize live offsets and apply it later" it is almost exactly what this patch do.
At fact it memorize live offsets, but also do not keeps dead pieces when builds a list of them.

I think problem here that my patch was built on a half day old source code, that is probably why it looks like I introduced something new,
but Pieces and Ranges are just about the same.

So your way is to apply live bit and store all pieces, my way was to store only live pieces and that is why I even was need to save
data size separatelly (because I was not able to substract piece 1 offset from piece 2 offset if the latter was dead, I just did not have it in the list).

Actually I was sure that it is slightly better way, I tried to save all possible resources including memory,
since storing dead pieces is a waste. But your approach looks cleaner in implementation for me, so I would go with it.


More information about the llvm-commits mailing list