11pub mod llvm;
22mod simd;
33
4+ #[ cfg( feature="master" ) ]
45use std:: iter;
56
67use gccjit:: { ComparisonOp , Function , RValue , ToRValue , Type , UnaryOp , FunctionType } ;
@@ -9,16 +10,24 @@ use rustc_codegen_ssa::base::wants_msvc_seh;
910use rustc_codegen_ssa:: common:: { IntPredicate , span_invalid_monomorphization_error} ;
1011use rustc_codegen_ssa:: mir:: operand:: { OperandRef , OperandValue } ;
1112use rustc_codegen_ssa:: mir:: place:: PlaceRef ;
12- use rustc_codegen_ssa:: traits:: { ArgAbiMethods , BaseTypeMethods , BuilderMethods , ConstMethods , DerivedTypeMethods , IntrinsicCallMethods , MiscMethods } ;
13+ use rustc_codegen_ssa:: traits:: { ArgAbiMethods , BaseTypeMethods , BuilderMethods , ConstMethods , IntrinsicCallMethods } ;
14+ #[ cfg( feature="master" ) ]
15+ use rustc_codegen_ssa:: traits:: { DerivedTypeMethods , MiscMethods } ;
1316use rustc_middle:: bug;
1417use rustc_middle:: ty:: { self , Instance , Ty } ;
15- use rustc_middle:: ty:: layout:: { FnAbiOf , HasTyCtxt , LayoutOf } ;
18+ use rustc_middle:: ty:: layout:: LayoutOf ;
19+ #[ cfg( feature="master" ) ]
20+ use rustc_middle:: ty:: layout:: { FnAbiOf , HasTyCtxt } ;
1621use rustc_span:: { Span , Symbol , symbol:: kw, sym} ;
1722use rustc_target:: abi:: HasDataLayout ;
1823use rustc_target:: abi:: call:: { ArgAbi , FnAbi , PassMode } ;
19- use rustc_target:: spec:: { abi:: Abi , PanicStrategy } ;
24+ use rustc_target:: spec:: PanicStrategy ;
25+ #[ cfg( feature="master" ) ]
26+ use rustc_target:: spec:: abi:: Abi ;
2027
21- use crate :: abi:: { FnAbiGccExt , GccType } ;
28+ use crate :: abi:: GccType ;
29+ #[ cfg( feature="master" ) ]
30+ use crate :: abi:: FnAbiGccExt ;
2231use crate :: builder:: Builder ;
2332use crate :: common:: { SignType , TypeReflection } ;
2433use crate :: context:: CodegenCx ;
@@ -1117,7 +1126,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
11171126 }
11181127}
11191128
1120- fn try_intrinsic < ' a , ' b , ' gcc , ' tcx > ( bx : & ' b mut Builder < ' a , ' gcc , ' tcx > , try_func : RValue < ' gcc > , data : RValue < ' gcc > , catch_func : RValue < ' gcc > , dest : RValue < ' gcc > ) {
1129+ fn try_intrinsic < ' a , ' b , ' gcc , ' tcx > ( bx : & ' b mut Builder < ' a , ' gcc , ' tcx > , try_func : RValue < ' gcc > , data : RValue < ' gcc > , _catch_func : RValue < ' gcc > , dest : RValue < ' gcc > ) {
11211130 if bx. sess ( ) . panic_strategy ( ) == PanicStrategy :: Abort {
11221131 bx. call ( bx. type_void ( ) , try_func, & [ data] , None ) ;
11231132 // Return 0 unconditionally from the intrinsic call;
@@ -1129,7 +1138,10 @@ fn try_intrinsic<'a, 'b, 'gcc, 'tcx>(bx: &'b mut Builder<'a, 'gcc, 'tcx>, try_fu
11291138 unimplemented ! ( ) ;
11301139 }
11311140 else {
1132- codegen_gnu_try ( bx, try_func, data, catch_func, dest) ;
1141+ #[ cfg( feature="master" ) ]
1142+ codegen_gnu_try ( bx, try_func, data, _catch_func, dest) ;
1143+ #[ cfg( not( feature="master" ) ) ]
1144+ unimplemented ! ( ) ;
11331145 }
11341146}
11351147
@@ -1144,6 +1156,7 @@ fn try_intrinsic<'a, 'b, 'gcc, 'tcx>(bx: &'b mut Builder<'a, 'gcc, 'tcx>, try_fu
11441156// function calling it, and that function may already have other personality
11451157// functions in play. By calling a shim we're guaranteed that our shim will have
11461158// the right personality function.
1159+ #[ cfg( feature="master" ) ]
11471160fn codegen_gnu_try < ' gcc > ( bx : & mut Builder < ' _ , ' gcc , ' _ > , try_func : RValue < ' gcc > , data : RValue < ' gcc > , catch_func : RValue < ' gcc > , dest : RValue < ' gcc > ) {
11481161 //use std::ops::Deref;
11491162 //let cx: &CodegenCx<'gcc, '_> = bx.deref();
@@ -1210,6 +1223,7 @@ fn codegen_gnu_try<'gcc>(bx: &mut Builder<'_, 'gcc, '_>, try_func: RValue<'gcc>,
12101223// catch exceptions.
12111224//
12121225// This function is only generated once and is then cached.
1226+ #[ cfg( feature="master" ) ]
12131227fn get_rust_try_fn < ' a , ' gcc , ' tcx > ( cx : & ' a CodegenCx < ' gcc , ' tcx > , codegen : & mut dyn FnMut ( Builder < ' a , ' gcc , ' tcx > ) ) -> ( Type < ' gcc > , Function < ' gcc > ) {
12141228 if let Some ( llfn) = cx. rust_try_fn . get ( ) {
12151229 return llfn;
@@ -1249,6 +1263,7 @@ fn get_rust_try_fn<'a, 'gcc, 'tcx>(cx: &'a CodegenCx<'gcc, 'tcx>, codegen: &mut
12491263
12501264// Helper function to give a Block to a closure to codegen a shim function.
12511265// This is currently primarily used for the `try` intrinsic functions above.
1266+ #[ cfg( feature="master" ) ]
12521267fn gen_fn < ' a , ' gcc , ' tcx > ( cx : & ' a CodegenCx < ' gcc , ' tcx > , name : & str , rust_fn_sig : ty:: PolyFnSig < ' tcx > , codegen : & mut dyn FnMut ( Builder < ' a , ' gcc , ' tcx > ) ) -> ( Type < ' gcc > , Function < ' gcc > ) {
12531268 let fn_abi = cx. fn_abi_of_fn_ptr ( rust_fn_sig, ty:: List :: empty ( ) ) ;
12541269 let ( typ, _, _, _) = fn_abi. gcc_type ( cx) ;
0 commit comments