This is an archive of the discontinued LLVM Phabricator instance.

[GlobalMerge] Revert "Use private linkage for MergedGlobals variables" on Darwin.
ClosedPublic

Authored by aprantl on Nov 10 2016, 5:19 PM.

Details

Summary

This is a partial revert of r244615 (http://reviews.llvm.org/D11942), which caused a major regression in debug info quality.

Turning the artificial __MergedGlobal symbols into private symbols (l__MergedGlobal) means that the linker will not include them in the symbol table of the final executable. Without a symbol table entry dsymutil is not be able to process the debug info for any of the merged globals and thus drops the debug info for all of them.

This patch is enabling the old behavior for all MachO targets while leaving all other targets unaffected.

rdar://problem/29160481

Diff Detail

Event Timeline

aprantl updated this revision to Diff 77575.Nov 10 2016, 5:19 PM
aprantl retitled this revision from to [GlobalMerge] Revert "Use private linkage for MergedGlobals variables" on Darwin..
aprantl updated this object.
aprantl set the repository for this revision to rL LLVM.
aprantl added subscribers: steven_wu, friss.
ab accepted this revision.Nov 11 2016, 9:16 AM
ab edited edge metadata.

LGTM.

lib/CodeGen/GlobalMerge.cpp
463–475

Nit: compute the name/linkage upfront, based on IsMachO/HasExternal, and only new GlobalVariable once?

This revision is now accepted and ready to land.Nov 11 2016, 9:16 AM
aprantl closed this revision.Nov 14 2016, 1:28 PM

Thanks!
r286607 + r286610.