Skip to content

constants should be tagged with unnamed_addr to merge them #5613

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
thestinger opened this issue Mar 29, 2013 · 4 comments
Closed

constants should be tagged with unnamed_addr to merge them #5613

thestinger opened this issue Mar 29, 2013 · 4 comments
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@thestinger
Copy link
Contributor

LLVM only exposes setUnnamedAddr through the C++ API, sadly.

Marking constants this way allows LLVM to merge the representations, because it informs the compiler that the uniqueness of the address is unimportant.

If you absolutely must have a unique address, it should probably be expressed with an attribute.

@bstrie
Copy link
Contributor

bstrie commented May 28, 2013

Nominating for Maturity 5, Production Ready.

@thestinger
Copy link
Contributor Author

We probably can't really do this since the addresses are significant. I'll open more specific issues.

@sanxiyn
Copy link
Member

sanxiyn commented May 31, 2013

#6787 exposed unnamed_addr, which should help this issue.

@thestinger thestinger reopened this Aug 9, 2013
@alexcrichton
Copy link
Member

I'm adding an attribute for doing this in #8421

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

4 participants