diff options
Diffstat (limited to 'include/llvm/GlobalValue.h')
-rw-r--r-- | include/llvm/GlobalValue.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/llvm/GlobalValue.h b/include/llvm/GlobalValue.h index 81a11a4..d43a2fa 100644 --- a/include/llvm/GlobalValue.h +++ b/include/llvm/GlobalValue.h @@ -192,6 +192,14 @@ public: Linkage == LinkerPrivateWeakDefAutoLinkage; } + /// mayBeRemovedByLinker - Whether the definition of this global may be + /// removed at link time. + static bool mayBeRemovedByLinker(LinkageTypes Linkage) { + return isLinkerPrivateLinkage(Linkage) || + isLinkerPrivateWeakLinkage(Linkage) || + isLinkerPrivateWeakDefAutoLinkage(Linkage); + } + bool hasExternalLinkage() const { return isExternalLinkage(Linkage); } bool hasAvailableExternallyLinkage() const { return isAvailableExternallyLinkage(Linkage); @@ -225,6 +233,8 @@ public: bool isWeakForLinker() const { return isWeakForLinker(Linkage); } + bool mayBeRemovedByLinker() const { return mayBeRemovedByLinker(Linkage); } + /// copyAttributesFrom - copy all additional attributes (those not needed to /// create a GlobalValue) from the GlobalValue Src to this one. virtual void copyAttributesFrom(const GlobalValue *Src); |