summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorShoaib Meenai <smeenai@fb.com>2018-01-26 00:15:25 +0000
committerShoaib Meenai <smeenai@fb.com>2018-01-26 00:15:25 +0000
commitd8fd16b08f1fdcf0ef5294624be826a6cd38eb86 (patch)
tree7b3c15117100972332cf9ca39148a8e7c438af0e /llvm/lib/CodeGen
parent6394df9fc48b26c65cf525d92500c5b43ba81fdc (diff)
downloadbcm5719-llvm-d8fd16b08f1fdcf0ef5294624be826a6cd38eb86.tar.gz
bcm5719-llvm-d8fd16b08f1fdcf0ef5294624be826a6cd38eb86.zip
[CodeGen] Ignore private symbols in llvm.used for COFF
Similar to the existing handling for internal symbols, private symbols are also not visible to the linker and should be ignored. llvm-svn: 323483
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 87d91377dc9..92429acb2b8 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1456,10 +1456,10 @@ bool AsmPrinter::doFinalization(Module &M) {
for (const Value *Op : A->operands()) {
const auto *GV =
cast<GlobalValue>(Op->stripPointerCastsNoFollowAliases());
- // Global symbols with internal linkage are not visible to the linker,
- // and thus would cause an error when the linker tried to preserve the
- // symbol due to the `/include:` directive.
- if (GV->hasInternalLinkage())
+ // Global symbols with internal or private linkage are not visible to
+ // the linker, and thus would cause an error when the linker tried to
+ // preserve the symbol due to the `/include:` directive.
+ if (GV->hasInternalLinkage() || GV->hasPrivateLinkage())
continue;
raw_string_ostream OS(Flags);
OpenPOWER on IntegriCloud