Skip to content

properly name the constant memory exposed to llvm #50862

@oli-obk

Description

@oli-obk

Due to historic accidents and severe cases of laziness, all allocations created by constant evaluation are named byte_str. This naming does not improve the debuggability of LLVM-IR and is rarely correct.

It would be great if the name given to the allocation would either be something derived from the context of the allocation (like the name of the static/constant/function that the allocation belongs to), or in case such information cannot be derived, either produce no name or just data as a fallback.

Proposed order of steps:

  1. rename byte_str to data and adjust tests accordingly
  2. Pass down None::<String> in
    pub fn from_const(bx: &Builder<'a, 'tcx>,
    and
    pub fn primval_to_llvm(cx: &CodegenCx,
    and potentially the functions calling either of these two functions.
  3. Replace those None::<String> with an actual value where such information is available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-cleanupCategory: PRs that clean code up or issues documenting cleanup.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions