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
Nit: compute the name/linkage upfront, based on IsMachO/HasExternal, and only new GlobalVariable once?