[PATCH] D40999: [llvm-objcopy] Aggressively remove templates to decrease code size

Jake Ehrlich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 7 19:10:45 PST 2017


jakehehrlich created this revision.
Herald added a subscriber: mehdi_amini.

Prioir to supporting all 4 ELF formats the fully optimized LTO llvm-objcopy was 650 KB, afterwards it was 3.5 MB. This size increase was an issue for Chromium people who plan on shipping llvm-objcopy as part of the chromium toolchain (why this size issue exists is still a mystery to me). This change splits several classes into template and non template parts so that as little identical code is reproduced as possible. I measure the size afterwards to be 774 KB which is hardly bigger than 650 KB. Going forward this pattern should be followed to minimize the size increase we experience overtime.


Repository:
  rL LLVM

https://reviews.llvm.org/D40999

Files:
  tools/llvm-objcopy/Object.cpp
  tools/llvm-objcopy/Object.h
  tools/llvm-objcopy/llvm-objcopy.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40999.126091.patch
Type: text/x-patch
Size: 19364 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171208/833829b0/attachment.bin>


More information about the llvm-commits mailing list