Use a dedicated safe wrapper for LLVMRustGetHostCPUName

This commit is contained in:
Zalathar 2024-11-02 11:44:15 +11:00
parent 36040aacc2
commit 0fa86f9660
3 changed files with 23 additions and 15 deletions

View file

@ -382,9 +382,9 @@ extern "C" void LLVMRustGetTargetFeature(LLVMTargetMachineRef TM, size_t Index,
*Desc = Feat.Desc;
}
extern "C" const char *LLVMRustGetHostCPUName(size_t *len) {
extern "C" const char *LLVMRustGetHostCPUName(size_t *OutLen) {
StringRef Name = sys::getHostCPUName();
*len = Name.size();
*OutLen = Name.size();
return Name.data();
}