compiler: replace cstr macro with c str literals in compiler and few other c str replacements

This commit is contained in:
klensy 2023-12-03 14:02:31 +03:00
parent 71940e0a8a
commit 26e69a8816
14 changed files with 42 additions and 71 deletions

View file

@ -112,7 +112,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 {
@ -120,17 +120,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(),
);
}