1+ #[ cfg( feature = "master" ) ]
12use std:: convert:: TryInto ;
23
3- use gccjit:: { CType , RValue , Struct , Type } ;
4+ #[ cfg( feature = "master" ) ]
5+ use gccjit:: CType ;
6+ use gccjit:: { RValue , Struct , Type } ;
47use rustc_codegen_ssa:: common:: TypeKind ;
58use rustc_codegen_ssa:: traits:: { BaseTypeMethods , DerivedTypeMethods , TypeMembershipMethods } ;
69use rustc_middle:: ty:: layout:: TyAndLayout ;
@@ -124,7 +127,7 @@ impl<'gcc, 'tcx> BaseTypeMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
124127
125128 #[ cfg( feature = "master" ) ]
126129 fn type_f16 ( & self ) -> Type < ' gcc > {
127- if self . context . get_target_info ( ) . supports_target_dependent_type ( CType :: Float16 ) {
130+ if self . supports_f16_type {
128131 return self . context . new_c_type ( CType :: Float16 ) ;
129132 }
130133 unimplemented ! ( "f16" )
@@ -137,9 +140,9 @@ impl<'gcc, 'tcx> BaseTypeMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
137140
138141 #[ cfg( feature = "master" ) ]
139142 fn type_f32 ( & self ) -> Type < ' gcc > {
140- // if self.context.get_target_info().supports_target_dependent_type(CType::Float32) {
141- // return self.context.new_c_type(CType::Float32);
142- // }
143+ if self . supports_f32_type {
144+ return self . context . new_c_type ( CType :: Float32 ) ;
145+ }
143146 self . float_type
144147 }
145148
@@ -154,7 +157,7 @@ impl<'gcc, 'tcx> BaseTypeMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
154157
155158 #[ cfg( feature = "master" ) ]
156159 fn type_f128 ( & self ) -> Type < ' gcc > {
157- if self . context . get_target_info ( ) . supports_target_dependent_type ( CType :: Float128 ) {
160+ if self . supports_f128_type {
158161 return self . context . new_c_type ( CType :: Float128 ) ;
159162 }
160163 unimplemented ! ( "f128" )
0 commit comments