@@ -10,9 +10,9 @@ use crate::type_::Type;
10
10
use crate :: context:: { is_pie_binary, get_reloc_model} ;
11
11
use crate :: common;
12
12
use crate :: LlvmCodegenBackend ;
13
+ use rustc:: hir:: def_id:: LOCAL_CRATE ;
13
14
use rustc_codegen_ssa:: back:: write:: { CodegenContext , ModuleConfig , run_assembler} ;
14
15
use rustc_codegen_ssa:: traits:: * ;
15
- use rustc:: hir:: def_id:: LOCAL_CRATE ;
16
16
use rustc:: session:: config:: { self , OutputType , Passes , Lto } ;
17
17
use rustc:: session:: Session ;
18
18
use rustc:: ty:: TyCtxt ;
@@ -82,14 +82,6 @@ pub fn write_output_file(
82
82
}
83
83
}
84
84
85
- pub fn create_target_machine (
86
- tcx : TyCtxt < ' _ , ' _ , ' _ > ,
87
- find_features : bool ,
88
- ) -> & ' static mut llvm:: TargetMachine {
89
- target_machine_factory ( tcx. sess , tcx. backend_optimization_level ( LOCAL_CRATE ) , find_features) ( )
90
- . unwrap_or_else ( |err| llvm_err ( tcx. sess . diagnostic ( ) , & err) . raise ( ) )
91
- }
92
-
93
85
pub fn create_informational_target_machine (
94
86
sess : & Session ,
95
87
find_features : bool ,
@@ -99,6 +91,15 @@ pub fn create_informational_target_machine(
99
91
} )
100
92
}
101
93
94
+ pub fn create_target_machine (
95
+ tcx : TyCtxt < ' _ , ' _ , ' _ > ,
96
+ find_features : bool ,
97
+ ) -> & ' static mut llvm:: TargetMachine {
98
+ target_machine_factory ( & tcx. sess , tcx. backend_optimization_level ( LOCAL_CRATE ) , find_features) ( )
99
+ . unwrap_or_else ( |err| {
100
+ llvm_err ( tcx. sess . diagnostic ( ) , & err) . raise ( )
101
+ } )
102
+ }
102
103
103
104
pub fn to_llvm_opt_settings ( cfg : config:: OptLevel ) -> ( llvm:: CodeGenOptLevel , llvm:: CodeGenOptSize )
104
105
{
0 commit comments