]> granicus.if.org Git - clang/commit
Use llvm.compiler.used instead of llvm.used for objc symbols.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 6 Mar 2014 22:15:10 +0000 (22:15 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 6 Mar 2014 22:15:10 +0000 (22:15 +0000)
commitbb46ff589d60c109277728c9f94ff9ce9553eca1
tree5ec85b4bce32b149536feb17bcf6165a14901361
parent89cc7eee88468ef9f4c472f466621364fbc37f85
Use llvm.compiler.used instead of llvm.used for objc symbols.

LLVM currently has a hack (shouldEmitUsedDirectiveFor) that causes it to not
print no_dead_strip for symbols starting with 'l' or 'L'. These are exactly the
ones that the clang's objc codegen is producing. The net result, is that it is
equivalent to llvm.compiler.used.

The need for putting the private symbol in llvm.compiler.used should be clear
(the objc runtime uses them). The reason for also putting the weak symbols in
it is for LTO: ld64 will not ask us to preserve the it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203172 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGDecl.cpp
lib/CodeGen/CGObjCMac.cpp
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenObjC/forward-protocol-metadata-symbols.m