summaryrefslogtreecommitdiff
path: root/include/llvm/GlobalValue.h
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-07-05 23:48:30 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-07-05 23:48:30 +0000
commit80585f1daac3570f19cd255c5006dfcf2ff65a89 (patch)
tree3eafa71e339d218b73cf4c8888446bcfb0311a40 /include/llvm/GlobalValue.h
parent7ab23c429770d475f9d93cc93751a730b5bae887 (diff)
downloadllvm-80585f1daac3570f19cd255c5006dfcf2ff65a89.tar.gz
llvm-80585f1daac3570f19cd255c5006dfcf2ff65a89.tar.bz2
llvm-80585f1daac3570f19cd255c5006dfcf2ff65a89.tar.xz
Add convenient helper for checking whether global is weak in linker sense
having weak or linkonce or common or extweak LLVM linkage. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53158 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/GlobalValue.h')
-rw-r--r--include/llvm/GlobalValue.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/GlobalValue.h b/include/llvm/GlobalValue.h
index bc0c0a7937..6b6610b724 100644
--- a/include/llvm/GlobalValue.h
+++ b/include/llvm/GlobalValue.h
@@ -110,6 +110,15 @@ public:
void setLinkage(LinkageTypes LT) { Linkage = LT; }
LinkageTypes getLinkage() const { return Linkage; }
+ /// isWeakForLinker - Determines if symbol is weak for linker having weak or
+ /// linkonce or common or extweak LLVM linkage.
+ bool isWeakForLinker() const {
+ return (Linkage == WeakLinkage ||
+ Linkage == LinkOnceLinkage ||
+ Linkage == CommonLinkage ||
+ Linkage == ExternalWeakLinkage);
+ }
+
/// 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);