From 1a525e8c80305777e3ca0cba0e1903fdbf04aa86 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 9 Oct 2013 16:07:32 +0000 Subject: 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 --- include/llvm/IR/GlobalAlias.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') 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(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; -- cgit v1.1