@@ -4,7 +4,7 @@ use std::collections::HashMap;
4
4
use gccjit:: {
5
5
Block , CType , Context , Function , FunctionPtrType , FunctionType , LValue , Location , RValue , Type ,
6
6
} ;
7
- use rustc_abi:: { HasDataLayout , PointeeInfo , Size , TargetDataLayout , VariantIdx } ;
7
+ use rustc_abi:: { Align , HasDataLayout , PointeeInfo , Size , TargetDataLayout , VariantIdx } ;
8
8
use rustc_codegen_ssa:: base:: wants_msvc_seh;
9
9
use rustc_codegen_ssa:: errors as ssa_errors;
10
10
use rustc_codegen_ssa:: traits:: { BackendTypes , BaseTypeCodegenMethods , MiscCodegenMethods } ;
@@ -135,6 +135,9 @@ pub struct CodegenCx<'gcc, 'tcx> {
135
135
136
136
#[ cfg( feature = "master" ) ]
137
137
pub cleanup_blocks : RefCell < FxHashSet < Block < ' gcc > > > ,
138
+ /// The alignment of a u128/i128 type.
139
+ // We cache this, since it is needed for alignment checks during loads.
140
+ pub int128_align : Align ,
138
141
}
139
142
140
143
impl < ' gcc , ' tcx > CodegenCx < ' gcc , ' tcx > {
@@ -226,6 +229,11 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
226
229
}
227
230
228
231
let mut cx = Self {
232
+ int128_align : tcx
233
+ . layout_of ( ty:: TypingEnv :: fully_monomorphized ( ) . as_query_input ( tcx. types . i128 ) )
234
+ . expect ( "Can't get the layout of `i128`" )
235
+ . align
236
+ . abi ,
229
237
const_cache : Default :: default ( ) ,
230
238
codegen_unit,
231
239
context,
0 commit comments