@@ -23,7 +23,7 @@ use llvm_util;
23
23
use ModuleLlvm ;
24
24
use rustc_codegen_ssa:: { ModuleCodegen , CompiledModule } ;
25
25
use rustc:: util:: common:: time_ext;
26
- use rustc_fs_util:: { path2cstr , link_or_copy} ;
26
+ use rustc_fs_util:: { path_to_c_string , link_or_copy} ;
27
27
use rustc_data_structures:: small_c_str:: SmallCStr ;
28
28
use errors:: { self , Handler , FatalError } ;
29
29
use type_:: Type ;
@@ -80,7 +80,7 @@ pub fn write_output_file(
80
80
output : & Path ,
81
81
file_type : llvm:: FileType ) -> Result < ( ) , FatalError > {
82
82
unsafe {
83
- let output_c = path2cstr ( output) ;
83
+ let output_c = path_to_c_string ( output) ;
84
84
let result = llvm:: LLVMRustWriteOutputFile ( target, pm, m, output_c. as_ptr ( ) , file_type) ;
85
85
if result. into_result ( ) . is_err ( ) {
86
86
let msg = format ! ( "could not write output to {}" , output. display( ) ) ;
@@ -211,7 +211,7 @@ pub(crate) fn save_temp_bitcode(
211
211
let ext = format ! ( "{}.bc" , name) ;
212
212
let cgu = Some ( & module. name [ ..] ) ;
213
213
let path = cgcx. output_filenames . temp_path_ext ( & ext, cgu) ;
214
- let cstr = path2cstr ( & path) ;
214
+ let cstr = path_to_c_string ( & path) ;
215
215
let llmod = module. module_llvm . llmod ( ) ;
216
216
llvm:: LLVMWriteBitcodeToFile ( llmod, cstr. as_ptr ( ) ) ;
217
217
}
@@ -324,7 +324,7 @@ pub(crate) unsafe fn optimize(cgcx: &CodegenContext<LlvmCodegenBackend>,
324
324
325
325
if config. emit_no_opt_bc {
326
326
let out = cgcx. output_filenames . temp_path_ext ( "no-opt.bc" , module_name) ;
327
- let out = path2cstr ( & out) ;
327
+ let out = path_to_c_string ( & out) ;
328
328
llvm:: LLVMWriteBitcodeToFile ( llmod, out. as_ptr ( ) ) ;
329
329
}
330
330
@@ -530,7 +530,7 @@ pub(crate) unsafe fn codegen(cgcx: &CodegenContext<LlvmCodegenBackend>,
530
530
|| -> Result < ( ) , FatalError > {
531
531
if config. emit_ir {
532
532
let out = cgcx. output_filenames . temp_path ( OutputType :: LlvmAssembly , module_name) ;
533
- let out = path2cstr ( & out) ;
533
+ let out = path_to_c_string ( & out) ;
534
534
535
535
extern "C" fn demangle_callback ( input_ptr : * const c_char ,
536
536
input_len : size_t ,
0 commit comments