diff options
author | Martin Storsjo <martin@martin.st> | 2018-01-24 06:40:04 +0000 |
---|---|---|
committer | Martin Storsjo <martin@martin.st> | 2018-01-24 06:40:04 +0000 |
commit | e8248f2e106e8a9ab3ddcce637a15e811300cc7a (patch) | |
tree | 897d171cccd10dea150e18dc9b7324f5eafd2507 /llvm/lib/CodeGen/GlobalMerge.cpp | |
parent | ae21466138bd078901ed8cc90228155a30529ab3 (diff) | |
download | bcm5719-llvm-e8248f2e106e8a9ab3ddcce637a15e811300cc7a.tar.gz bcm5719-llvm-e8248f2e106e8a9ab3ddcce637a15e811300cc7a.zip |
[GlobalMerge] Don't merge dllexport globals
Merging such globals loses the dllexport attribute. Add a test
to check that normal globals still are merged.
Differential Revision: https://reviews.llvm.org/D42127
llvm-svn: 323307
Diffstat (limited to 'llvm/lib/CodeGen/GlobalMerge.cpp')
-rw-r--r-- | llvm/lib/CodeGen/GlobalMerge.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/GlobalMerge.cpp b/llvm/lib/CodeGen/GlobalMerge.cpp index 8b9545da914..3888226fa05 100644 --- a/llvm/lib/CodeGen/GlobalMerge.cpp +++ b/llvm/lib/CodeGen/GlobalMerge.cpp @@ -577,7 +577,8 @@ bool GlobalMerge::doInitialization(Module &M) { for (auto &GV : M.globals()) { // Merge is safe for "normal" internal or external globals only if (GV.isDeclaration() || GV.isThreadLocal() || - GV.hasSection() || GV.hasImplicitSection()) + GV.hasSection() || GV.hasImplicitSection() || + GV.hasDLLExportStorageClass()) continue; // It's not safe to merge globals that may be preempted |