This simply marks the global with the unnamed_addr IR attribute so it
be merged with other globals. This can break C++ pointer identity.
Add a warning -Wunnamed-addr that warns when putting the attribute on a
non-const or non-POD global since those can't be merged anyway.
Some users have said that they still want to take the address of many
auto-generated globals for table-driven parsing (many of which may be
equivalent), but do not care about address equality and
would like to save some binary size.
What happens for tentative definitions where the value isn't known? e.g.,
What happens if the types are similar but not the same?
Should we diagnose taking the address of such an attributed variable so users have some hope of spotting the non-conforming situations?
Does this attribute have impacts across translation unit boundaries (perhaps only when doing LTO) or only within a single TU?
What does this attribute do in C++ in the presence of constructors and destructors? e.g.,