Skip to content

Static Item Duplication #16184

@jackheizer

Description

@jackheizer

This code:

static TEST: int = 10;
static TEST2: &'static int = &TEST;

Produces the following IR:

@_ZN4TEST20h60213af30ae88ef1eaaE = internal constant i64 10
@const = private constant i64 10
@_ZN5TEST220hc4be0dea553bf116iaaE = internal constant i64* @const

So TEST2 points to a duplicate of TEST, namely @const, rather than TEST itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions