diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-11-30 22:01:43 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-11-30 22:01:43 +0000 |
commit | a586fd2c5665c75c1b2870b1361d794ac25caf9e (patch) | |
tree | dcff8cccb600d1c6b43cd78ee5e6f53c28c59f09 /test/Linker/comdat12.ll | |
parent | ae5d4bfbbefb29e8759287f13bc1d3bb44474044 (diff) |
Start deciding earlier what to link.
A traditional linker is roughly split in symbol resolution and "copying
stuff".
The two tasks are badly mixed in lib/Linker.
This starts splitting them apart.
With this patch there are no direct call to linkGlobalValueBody or
linkGlobalValueProto. Everything is linked via WapValue.
This also includes a few fixes:
* A GV goes undefined if the comdat is dropped (comdat11.ll).
* We error if an internal GV goes undefined (comdat13.ll).
* We don't link an unused comdat.
The first two match the behavior of an ELF linker. The second one is
equivalent to running globaldce on the input.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254336 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Linker/comdat12.ll')
-rw-r--r-- | test/Linker/comdat12.ll | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Linker/comdat12.ll b/test/Linker/comdat12.ll new file mode 100644 index 00000000000..d06e222b63a --- /dev/null +++ b/test/Linker/comdat12.ll @@ -0,0 +1,8 @@ +; RUN: llvm-link %s -S -o - | FileCheck %s + +$foo = comdat largest +define internal void @foo() comdat($foo) { + ret void +} + +; CHECK-NOT: foo |