diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-10-09 16:07:32 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-10-09 16:07:32 +0000 |
commit | 1a525e8c80305777e3ca0cba0e1903fdbf04aa86 (patch) | |
tree | 439b7b96f5f46b5fca34443f3f730ad608b8dfce /include | |
parent | 3b73dea538d9c53e205d38bfbcf99dd64306874b (diff) | |
download | external_llvm-1a525e8c80305777e3ca0cba0e1903fdbf04aa86.zip external_llvm-1a525e8c80305777e3ca0cba0e1903fdbf04aa86.tar.gz external_llvm-1a525e8c80305777e3ca0cba0e1903fdbf04aa86.tar.bz2 |
Add a GlobalAlias::isValidLinkage to reduce code duplication.
Thanks to Reid Kleckner for the suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192298 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/IR/GlobalAlias.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/IR/GlobalAlias.h b/include/llvm/IR/GlobalAlias.h index e09fb6a..fec61a7 100644 --- a/include/llvm/IR/GlobalAlias.h +++ b/include/llvm/IR/GlobalAlias.h @@ -81,6 +81,11 @@ public: return const_cast<GlobalAlias *>(this)->resolveAliasedGlobal(stopOnWeak); } + static bool isValidLinkage(LinkageTypes L) { + return isExternalLinkage(L) || isLocalLinkage(L) || + isWeakLinkage(L) || isLinkOnceLinkage(L); + } + // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const Value *V) { return V->getValueID() == Value::GlobalAliasVal; |