Skip to content

constants should be tagged with unnamed_addr to merge them #5613

Closed

Description

@thestinger

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.

Activity

  1. bstrie commented on May 28, 2013

    @bstrie
    Contributor

    Nominating for Maturity 5, Production Ready.

  2. thestinger commented on May 28, 2013

    @thestinger
    ContributorAuthor

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

  3. sanxiyn commented on May 31, 2013

    @sanxiyn
    Contributor

    #6787 exposed unnamed_addr, which should help this issue.

  4. alexcrichton commented on Aug 9, 2013

    @alexcrichton
    Member

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

  5. added a commit that references this issue on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frontendArea: Compiler frontend (errors, parsing and HIR)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions