coverage: Don't convert symbol names to CString for FFI

This commit is contained in:
Zalathar 2023-07-24 17:47:47 +10:00
parent e184118683
commit 4b154bc8e2
3 changed files with 18 additions and 7 deletions

View file

@ -161,8 +161,11 @@ extern "C" void LLVMRustCoverageWriteMappingToBuffer(
CoverageMappingWriter.write(OS);
}
extern "C" LLVMValueRef LLVMRustCoverageCreatePGOFuncNameVar(LLVMValueRef F, const char *FuncName) {
StringRef FuncNameRef(FuncName);
extern "C" LLVMValueRef LLVMRustCoverageCreatePGOFuncNameVar(
LLVMValueRef F,
const char *FuncName,
size_t FuncNameLen) {
StringRef FuncNameRef(FuncName, FuncNameLen);
return wrap(createPGOFuncNameVar(*cast<Function>(unwrap(F)), FuncNameRef));
}