Add comdat key field to llvm.global_ctors and llvm.global_dtors
authorReid Kleckner <reid@kleckner.net>
Fri, 16 May 2014 20:39:27 +0000 (20:39 +0000)
committerReid Kleckner <reid@kleckner.net>
Fri, 16 May 2014 20:39:27 +0000 (20:39 +0000)
commit1ce308866915c9eab78486066d28d2107b7fede2
tree9de4e45b4a8b60edb08ccdb8d31577d12b38c2e9
parentdedd6203ad632d99de7648c43e482af8476ba6ed
Add comdat key field to llvm.global_ctors and llvm.global_dtors

This allows us to put dynamic initializers for weak data into the same
comdat group as the data being initialized.  This is necessary for MSVC
ABI compatibility.  Once we have comdats for guard variables, we can use
the combination to help GlobalOpt fire more often for weak data with
guarded initialization on other platforms.

Reviewers: nlewycky

Differential Revision: http://reviews.llvm.org/D3499

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209015 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
docs/LangRef.rst
include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
include/llvm/Target/TargetLoweringObjectFile.h
lib/Bitcode/Reader/BitcodeReader.cpp
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/TargetLoweringObjectFileImpl.cpp
lib/IR/AutoUpgrade.cpp
lib/IR/Verifier.cpp
lib/Transforms/ObjCARC/ObjCARCAPElim.cpp
lib/Transforms/Utils/CtorUtils.cpp
lib/Transforms/Utils/ModuleUtils.cpp
test/Linker/Inputs/old_global_ctors.3.4.bc [new file with mode: 0644]
test/Linker/global_ctors.ll [new file with mode: 0644]
test/MC/COFF/global_ctors_dtors.ll
test/Transforms/GlobalOpt/ctor-list-opt.ll
test/Verifier/global-ctors.ll [new file with mode: 0644]