[all-commits] [llvm/llvm-project] ac375c: [Bitcode] Avoid duplicating linker option when upg...

Steven Wu via All-commits all-commits at lists.llvm.org
Thu Jul 23 13:08:04 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ac375c2fe316dae6eb770b38f90d6b67fadd22ec
      https://github.com/llvm/llvm-project/commit/ac375c2fe316dae6eb770b38f90d6b67fadd22ec
  Author: Steven Wu <stevenwu at apple.com>
  Date:   2020-07-23 (Thu, 23 Jul 2020)

  Changed paths:
    M llvm/lib/Bitcode/Reader/BitcodeReader.cpp
    A llvm/test/Bitcode/Inputs/linker-options.bc
    A llvm/test/Bitcode/upgrade-linker-options-2.ll

  Log Message:
  -----------
  [Bitcode] Avoid duplicating linker option when upgrading

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

Reviewers: pcc, t.p.northover, dexonsmith, arphaman

Reviewed By: arphaman

Subscribers: hiraditya, jkorous, ributzka, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83688




More information about the All-commits mailing list