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