summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorYunzhong Gao <Yunzhong_Gao@playstation.sony.com>2013-12-03 18:05:14 +0000
committerYunzhong Gao <Yunzhong_Gao@playstation.sony.com>2013-12-03 18:05:14 +0000
commit9163e8bce6f75ec3fdf7ed15cc590d6ff255ca8c (patch)
treef225d201b7e3c868f144288aaba129b2d9760679 /llvm/lib
parentd6f21bdf5896a272442e474c9322d2e39bc27a72 (diff)
downloadbcm5719-llvm-9163e8bce6f75ec3fdf7ed15cc590d6ff255ca8c.tar.gz
bcm5719-llvm-9163e8bce6f75ec3fdf7ed15cc590d6ff255ca8c.zip
Teach the internalize pass to skip dllexported symbols because they could be
referenced in a way that even the linker does not see. Differential Revision: http://llvm-reviews.chandlerc.com/D2280 llvm-svn: 196300
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/IPO/Internalize.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/Internalize.cpp b/llvm/lib/Transforms/IPO/Internalize.cpp
index 962d3de3156..dae69ce0915 100644
--- a/llvm/lib/Transforms/IPO/Internalize.cpp
+++ b/llvm/lib/Transforms/IPO/Internalize.cpp
@@ -115,6 +115,10 @@ static bool shouldInternalize(const GlobalValue &GV,
if (GV.hasAvailableExternallyLinkage())
return false;
+ // Assume that dllexported symbols are referenced elsewhere
+ if (GV.hasDLLExportLinkage())
+ return false;
+
// Already has internal linkage
if (GV.hasLocalLinkage())
return false;
OpenPOWER on IntegriCloud