-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
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
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.