summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker
diff options
context:
space:
mode:
authorSteven Wu <stevenwu@apple.com>2018-11-13 17:35:04 +0000
committerSteven Wu <stevenwu@apple.com>2018-11-13 17:35:04 +0000
commitfa43892d6fdf77e373dcf54f1c934380b8731df2 (patch)
tree4908fa417e03b50a4713544230c993893fd38afb /llvm/lib/Linker
parent77c17e26eaca06626a4ad1d9b2ccaba28d15b62f (diff)
downloadbcm5719-llvm-fa43892d6fdf77e373dcf54f1c934380b8731df2.tar.gz
bcm5719-llvm-fa43892d6fdf77e373dcf54f1c934380b8731df2.zip
Revert "[ThinLTO] Internalize readonly globals"
This reverts commit 10c84a8f35cae4a9fc421648d9608fccda3925f2. llvm-svn: 346768
Diffstat (limited to 'llvm/lib/Linker')
-rw-r--r--llvm/lib/Linker/IRMover.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Linker/IRMover.cpp b/llvm/lib/Linker/IRMover.cpp
index 72e20ae0ba1..b304bfc401a 100644
--- a/llvm/lib/Linker/IRMover.cpp
+++ b/llvm/lib/Linker/IRMover.cpp
@@ -1062,6 +1062,11 @@ void IRLinker::prepareCompileUnitsForImport() {
ValueMap.MD()[CU->getRawEnumTypes()].reset(nullptr);
ValueMap.MD()[CU->getRawMacros()].reset(nullptr);
ValueMap.MD()[CU->getRawRetainedTypes()].reset(nullptr);
+ // We import global variables only temporarily in order for instcombine
+ // and globalopt to perform constant folding and static constructor
+ // evaluation. After that elim-avail-extern will covert imported globals
+ // back to declarations, so we don't need debug info for them.
+ ValueMap.MD()[CU->getRawGlobalVariables()].reset(nullptr);
// Imported entities only need to be mapped in if they have local
// scope, as those might correspond to an imported entity inside a
OpenPOWER on IntegriCloud