Auto merge of #46563 - michaelwoerister:make-anon-globals-private, r=alexcrichton

Make CGU-local globals private so they don't show up in the local symbol table.

Should reduce binary sizes. Great find, @eddyb!

r? @alexcrichton
(I have not tested this locally. Better wait for travis to turn green before approving)
This commit is contained in:
bors 2017-12-08 18:46:24 +00:00
commit ad3543db34

View file

@ -74,7 +74,7 @@ pub fn addr_of_mut(ccx: &CrateContext,
});
llvm::LLVMSetInitializer(gv, cv);
set_global_alignment(ccx, gv, align);
llvm::LLVMRustSetLinkage(gv, llvm::Linkage::InternalLinkage);
llvm::LLVMRustSetLinkage(gv, llvm::Linkage::PrivateLinkage);
SetUnnamedAddr(gv, true);
gv
}