CodeGen: handle llvm.used properly for COFF
authorSaleem Abdulrasool <compnerd@compnerd.org>
Sat, 20 Jan 2018 00:28:02 +0000 (00:28 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Sat, 20 Jan 2018 00:28:02 +0000 (00:28 +0000)
commit99f479abcf2c9b36daad04eb91cd0aafa659bb1d
tree331bb5b7a64e0b50fc139438a3ab4277080f188f
parent08bd14803cf6a89700db914b68affe98879f4049
CodeGen: handle llvm.used properly for COFF

`llvm.used` contains a list of pointers to named values which the
compiler, assembler, and linker are required to treat as if there is a
reference that they cannot see.  Ensure that the symbols are preserved
by adding an explicit `-include` reference to the linker command.

llvm-svn: 323017
llvm/include/llvm/CodeGen/TargetLoweringObjectFile.h
llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
llvm/include/llvm/IR/Mangler.h
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
llvm/lib/IR/Mangler.cpp
llvm/test/CodeGen/X86/coff-no-dead-strip.ll [new file with mode: 0644]