Page MenuHomePhabricator

[Bitcode] Avoid duplicating linker option when upgrading
ClosedPublic

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

Details

Summary

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
again.

rdar://64543389

Diff Detail

Event Timeline

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

Add comments in the tests.

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

rebase the patch and ping.

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