Do not split mergeable sections if they are gc'ed.
Previously, mergeable section's constructors did more than just setting member variables; it split section contents into small pieces. It is not always computationally cheap task because if the section is a mergeable string section, it needs to scan the entire section to split them by NUL characters. If a section would be thrown away by GC, that cost ended up being a waste of time. It is going to be larger problem if the section is compressed -- the whole time to uncompress it and split it up is going to be a waste. Luckily, we can defer section splitting after GC. We just have to remember which offsets are in use during GC and apply that later. This patch implements it. Differential Revision: http://reviews.llvm.org/D20516 llvm-svn: 270455
Loading
Please register or sign in to comment