Page MenuHomePhabricator

[Bitcode] Avoid duplicating linker option when upgrading

Authored by steven_wu on Jul 13 2020, 9:58 AM.



The upgrading path from old ModuleFlag based linker options to the new
NamedMetadata based linker option in in materializeMetadata() which gets
called once for the module and once for every GV. The linker options are
getting dup'ed every time and it can create massive amount of the linker
options in the object file that gets created from old bitcode. Fix the
problem by checking if the new option exists or not before upgrade


Diff Detail

Event Timeline

steven_wu created this revision.Jul 13 2020, 9:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2020, 9:58 AM

Add comments in the tests.

steven_wu updated this revision to Diff 280158.Jul 23 2020, 9:09 AM

rebase the patch and ping.

arphaman accepted this revision.Jul 23 2020, 12:22 PM
This revision is now accepted and ready to land.Jul 23 2020, 12:22 PM
This revision was automatically updated to reflect the committed changes.