diff options
author | Bill Wendling <isanbard@gmail.com> | 2010-06-29 21:24:00 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2010-06-29 21:24:00 +0000 |
commit | f8b6137ea514c38511dbeedde9c02e27c937cad3 (patch) | |
tree | 341cb2f4392d2d0af87f4cd7b694a87333c47cc7 /include/llvm/GlobalValue.h | |
parent | fe9cd29675ecc34fe1b0308b26b36f389e0bccac (diff) | |
download | external_llvm-f8b6137ea514c38511dbeedde9c02e27c937cad3.zip external_llvm-f8b6137ea514c38511dbeedde9c02e27c937cad3.tar.gz external_llvm-f8b6137ea514c38511dbeedde9c02e27c937cad3.tar.bz2 |
Introducing the "linker_weak" linkage type. This will be used for Objective-C
metadata types which should be marked as "weak", but which the linker will
remove upon final linkage. For example, the "objc_msgSend_fixup_alloc" symbol is
defined like this:
.globl l_objc_msgSend_fixup_alloc
.weak_definition l_objc_msgSend_fixup_alloc
.section __DATA, __objc_msgrefs, coalesced
.align 3
l_objc_msgSend_fixup_alloc:
.quad _objc_msgSend_fixup
.quad L_OBJC_METH_VAR_NAME_1
This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107205 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/GlobalValue.h')
-rw-r--r-- | include/llvm/GlobalValue.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/llvm/GlobalValue.h b/include/llvm/GlobalValue.h index 658967d..5132d39 100644 --- a/include/llvm/GlobalValue.h +++ b/include/llvm/GlobalValue.h @@ -39,7 +39,8 @@ public: AppendingLinkage, ///< Special purpose, only applies to global arrays InternalLinkage, ///< Rename collisions when linking (static functions). PrivateLinkage, ///< Like Internal, but omit from symbol table. - LinkerPrivateLinkage, ///< Like Private, but linker removes. + LinkerPrivateLinkage, ///< Like private, but linker removes. + LinkerWeakLinkage, ///< Like linker private, but weak. DLLImportLinkage, ///< Function to be imported from DLL DLLExportLinkage, ///< Function to be accessible from DLL. ExternalWeakLinkage,///< ExternalWeak linkage description. @@ -132,7 +133,10 @@ public: return Linkage == PrivateLinkage; } static bool isLinkerPrivateLinkage(LinkageTypes Linkage) { - return Linkage==LinkerPrivateLinkage; + return Linkage == LinkerPrivateLinkage; + } + static bool isLinkerWeakLinkage(LinkageTypes Linkage) { + return Linkage == LinkerWeakLinkage; } static bool isLocalLinkage(LinkageTypes Linkage) { return isInternalLinkage(Linkage) || isPrivateLinkage(Linkage) || @@ -187,6 +191,7 @@ public: bool hasInternalLinkage() const { return isInternalLinkage(Linkage); } bool hasPrivateLinkage() const { return isPrivateLinkage(Linkage); } bool hasLinkerPrivateLinkage() const { return isLinkerPrivateLinkage(Linkage); } + bool hasLinkerWeakLinkage() const { return isLinkerWeakLinkage(Linkage); } bool hasLocalLinkage() const { return isLocalLinkage(Linkage); } bool hasDLLImportLinkage() const { return isDLLImportLinkage(Linkage); } bool hasDLLExportLinkage() const { return isDLLExportLinkage(Linkage); } |