From 5f4ee1fc5d00ae55c30fa2ce450c69be4c6d6e63 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Wed, 11 Mar 2009 08:08:06 +0000 Subject: Remove the one-definition-rule version of extern_weak linkage: this linkage type only applies to declarations, but ODR is only relevant to globals with definitions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66650 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/GlobalValue.h | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'include/llvm/GlobalValue.h') diff --git a/include/llvm/GlobalValue.h b/include/llvm/GlobalValue.h index 45528b2713..7b1bfc0494 100644 --- a/include/llvm/GlobalValue.h +++ b/include/llvm/GlobalValue.h @@ -40,8 +40,7 @@ public: PrivateLinkage, ///< Like Internal, but omit from symbol table DLLImportLinkage, ///< Function to be imported from DLL DLLExportLinkage, ///< Function to be accessible from DLL - ExternalWeakAnyLinkage,///< ExternalWeak linkage description - ExternalWeakODRLinkage,///< Same, but only replaced by something equivalent. + ExternalWeakLinkage,///< ExternalWeak linkage description GhostLinkage, ///< Stand-in functions for streaming fns from BC files CommonAnyLinkage, ///< Tentative definitions CommonODRLinkage ///< Same, but only replaced by something equivalent. @@ -112,9 +111,6 @@ public: static LinkageTypes getCommonLinkage(bool ODR) { return ODR ? CommonODRLinkage : CommonAnyLinkage; } - static LinkageTypes getExternalWeakLinkage(bool ODR) { - return ODR ? ExternalWeakODRLinkage : ExternalWeakAnyLinkage; - } bool hasExternalLinkage() const { return Linkage == ExternalLinkage; } bool hasLinkOnceLinkage() const { @@ -131,10 +127,7 @@ public: } bool hasDLLImportLinkage() const { return Linkage == DLLImportLinkage; } bool hasDLLExportLinkage() const { return Linkage == DLLExportLinkage; } - bool hasExternalWeakLinkage() const { - return Linkage == ExternalWeakAnyLinkage || - Linkage == ExternalWeakODRLinkage; - } + bool hasExternalWeakLinkage() const { return Linkage == ExternalWeakLinkage; } bool hasGhostLinkage() const { return Linkage == GhostLinkage; } bool hasCommonLinkage() const { return Linkage == CommonAnyLinkage || Linkage == CommonODRLinkage; @@ -150,7 +143,7 @@ public: return (Linkage == WeakAnyLinkage || Linkage == LinkOnceAnyLinkage || Linkage == CommonAnyLinkage || - Linkage == ExternalWeakAnyLinkage); + Linkage == ExternalWeakLinkage); } /// isWeakForLinker - Whether the definition of this global may be replaced at @@ -162,8 +155,7 @@ public: Linkage == LinkOnceODRLinkage || Linkage == CommonAnyLinkage || Linkage == CommonODRLinkage || - Linkage == ExternalWeakAnyLinkage || - Linkage == ExternalWeakODRLinkage); + Linkage == ExternalWeakLinkage); } /// copyAttributesFrom - copy all additional attributes (those not needed to -- cgit v1.2.3