From 80d5569dba0ed1d1719920dcea3744d529e29f4f Mon Sep 17 00:00:00 2001 From: Evgeniy Stepanov Date: Tue, 8 Sep 2015 18:25:20 +0000 Subject: [PATCH] Fix isDiscardableIfUnused to include available_externally linkage. AvailableExternally functions are discardable. llvm-svn: 247044 --- llvm/include/llvm/IR/GlobalValue.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/include/llvm/IR/GlobalValue.h b/llvm/include/llvm/IR/GlobalValue.h index 2961369a7327..eb6af5078160 100644 --- a/llvm/include/llvm/IR/GlobalValue.h +++ b/llvm/include/llvm/IR/GlobalValue.h @@ -236,7 +236,8 @@ public: /// Whether the definition of this global may be discarded if it is not used /// in its compilation unit. static bool isDiscardableIfUnused(LinkageTypes Linkage) { - return isLinkOnceLinkage(Linkage) || isLocalLinkage(Linkage); + return isLinkOnceLinkage(Linkage) || isLocalLinkage(Linkage) || + isAvailableExternallyLinkage(Linkage); } /// Whether the definition of this global may be replaced by something