use new c literals instead of cstr! macro

This commit is contained in:
klensy
2023-05-16 18:43:23 +03:00
parent e4f7ad8e68
commit a17561ffc9
13 changed files with 48 additions and 71 deletions

View File

@@ -113,7 +113,7 @@ impl<'ll, 'tcx> CodegenUnitDebugContext<'ll, 'tcx> {
llvm::LLVMRustAddModuleFlag(
self.llmod,
llvm::LLVMModFlagBehavior::Warning,
"Dwarf Version\0".as_ptr().cast(),
c"Dwarf Version".as_ptr().cast(),
dwarf_version,
);
} else {
@@ -121,17 +121,16 @@ impl<'ll, 'tcx> CodegenUnitDebugContext<'ll, 'tcx> {
llvm::LLVMRustAddModuleFlag(
self.llmod,
llvm::LLVMModFlagBehavior::Warning,
"CodeView\0".as_ptr().cast(),
c"CodeView".as_ptr().cast(),
1,
)
}
// Prevent bitcode readers from deleting the debug info.
let ptr = "Debug Info Version\0".as_ptr();
llvm::LLVMRustAddModuleFlag(
self.llmod,
llvm::LLVMModFlagBehavior::Warning,
ptr.cast(),
c"Debug Info Version".as_ptr().cast(),
llvm::LLVMRustDebugMetadataVersion(),
);
}