Skip to content

Update LLVM backend to use arbitrary precision integer for createEnumerator debug info #645

@andrewrk

Description

@andrewrk

Currently if an enum tag has greater than 63 bits, we cannot create correct debug info for it.
http://lists.llvm.org/pipermail/llvm-dev/2017-December/119475.html

For example, these two enums have incorrect debug info for the tag values.

const Foo = enum (u64) {
    A = 18446744073709551615,
    B = 1,
    C = 2,
};

const Bar = enum(u128) {
    A = 340282366920938463463374607431768211455,
    B = 1,
    C = 2,
};

LLVM's API needs to be updated to allow an APInt instead of int64_t for the tag value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend-llvmThe LLVM backend outputs an LLVM IR Module.contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions