@@ -359,7 +359,7 @@ pub struct CodegenContext<B: WriteBackendMethods> {
359359}
360360
361361impl < B : WriteBackendMethods > CodegenContext < B > {
362- pub fn create_diag_handler ( & self ) -> DiagCtxt {
362+ pub fn create_dcx ( & self ) -> DiagCtxt {
363363 DiagCtxt :: with_emitter ( Box :: new ( self . diag_emitter . clone ( ) ) )
364364 }
365365
@@ -825,7 +825,7 @@ fn execute_optimize_work_item<B: ExtraBackendMethods>(
825825 module : ModuleCodegen < B :: Module > ,
826826 module_config : & ModuleConfig ,
827827) -> Result < WorkItemResult < B > , FatalError > {
828- let diag_handler = cgcx. create_diag_handler ( ) ;
828+ let diag_handler = cgcx. create_dcx ( ) ;
829829
830830 unsafe {
831831 B :: optimize ( cgcx, & diag_handler, & module, module_config) ?;
@@ -891,11 +891,7 @@ fn execute_copy_from_cache_work_item<B: ExtraBackendMethods>(
891891 match link_or_copy ( & source_file, & output_path) {
892892 Ok ( _) => Some ( output_path) ,
893893 Err ( error) => {
894- cgcx. create_diag_handler ( ) . emit_err ( errors:: CopyPathBuf {
895- source_file,
896- output_path,
897- error,
898- } ) ;
894+ cgcx. create_dcx ( ) . emit_err ( errors:: CopyPathBuf { source_file, output_path, error } ) ;
899895 None
900896 }
901897 }
@@ -939,7 +935,7 @@ fn finish_intra_module_work<B: ExtraBackendMethods>(
939935 module : ModuleCodegen < B :: Module > ,
940936 module_config : & ModuleConfig ,
941937) -> Result < WorkItemResult < B > , FatalError > {
942- let diag_handler = cgcx. create_diag_handler ( ) ;
938+ let diag_handler = cgcx. create_dcx ( ) ;
943939
944940 if !cgcx. opts . unstable_opts . combine_cgu
945941 || module. kind == ModuleKind :: Metadata
@@ -1595,7 +1591,7 @@ fn start_executing_work<B: ExtraBackendMethods>(
15951591 let needs_link = mem:: take ( & mut needs_link) ;
15961592 if !needs_link. is_empty ( ) {
15971593 assert ! ( compiled_modules. is_empty( ) ) ;
1598- let diag_handler = cgcx. create_diag_handler ( ) ;
1594+ let diag_handler = cgcx. create_dcx ( ) ;
15991595 let module = B :: run_link ( & cgcx, & diag_handler, needs_link) . map_err ( |_| ( ) ) ?;
16001596 let module = unsafe {
16011597 B :: codegen ( & cgcx, & diag_handler, module, cgcx. config ( ModuleKind :: Regular ) )
0 commit comments