]> granicus.if.org Git - llvm/commit
LTO: Mark undefined module asm symbols as used.
authorPeter Collingbourne <peter@pcc.me.uk>
Wed, 26 Apr 2017 17:53:39 +0000 (17:53 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Wed, 26 Apr 2017 17:53:39 +0000 (17:53 +0000)
commit052412f4f5d512f4f7db833f6afbf83fe453c087
tree91a8aa5c3c484e5ba3859899e95465934bbb3ba3
parent86c47581d656f3233e11f698a0a73bb7b8dcc827
LTO: Mark undefined module asm symbols as used.

Marking them as used causes them to be considered visible outside of LTO. This
prevents the symbols from being internalized or discarded, either by GlobalDCE
or by summary-based dead stripping in ThinLTO.

This change makes it unnecessary to add these symbols to llvm.compiler.used
in the backend, as the symbols are kept alive by virtue of being external,
so remove the backend code that handles that.

Fixes PR32798.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301438 91177308-0d34-0410-b5e6-96231b3b80d8
lib/LTO/LTO.cpp
lib/LTO/LTOBackend.cpp
lib/Object/IRSymtab.cpp
test/LTO/Resolution/X86/Inputs/mod-asm-used.ll [new file with mode: 0644]
test/LTO/Resolution/X86/mod-asm-used.ll [new file with mode: 0644]
test/tools/gold/X86/asm_undefined2.ll