Skip to content

Migrate to LLVM{Get,Set}ValueName2 #64223

Closed
@hanna-kruppe

Description

@hanna-kruppe

We currently use the C APIs LLVM{Get,Set}ValueName which return/take a 0-terminated char *, but those APIs have been deprecated a while ago in favor of LLVM{Get,Set}ValueName2 which return/take pairs of char * + length (the C-friendly lowering of llvm::StringRef) which need not be 0-terminated. We should migrate to those APIs. Besides avoiding silly error cases for names that contain a 0 byte, it would also make conversions from &str to LLVM name free, and reduce the cost of the opposite direction to an UTF-8 validity check (plus, I suspect many or all code paths that do that could just as well use &[u8], and that conversion actually is 100% free).

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.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