Skip to content

Commit 8a1e581

Browse files
committed
Remove check_overflow method from MiscMethods
It can be retrieved from the Session too.
1 parent 9d25e85 commit 8a1e581

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

src/context.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ use crate::callee::get_fn;
2727
use crate::common::SignType;
2828

2929
pub struct CodegenCx<'gcc, 'tcx> {
30-
pub check_overflow: bool,
3130
pub codegen_unit: &'tcx CodegenUnit<'tcx>,
3231
pub context: &'gcc Context<'gcc>,
3332

@@ -134,8 +133,6 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
134133
tcx: TyCtxt<'tcx>,
135134
supports_128bit_integers: bool,
136135
) -> Self {
137-
let check_overflow = tcx.sess.overflow_checks();
138-
139136
let create_type = |ctype, rust_type| {
140137
let layout = tcx.layout_of(ParamEnv::reveal_all().and(rust_type)).unwrap();
141138
let align = layout.align.abi.bytes();
@@ -271,7 +268,6 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
271268
}
272269

273270
let mut cx = Self {
274-
check_overflow,
275271
codegen_unit,
276272
context,
277273
current_func: RefCell::new(None),
@@ -511,10 +507,6 @@ impl<'gcc, 'tcx> MiscMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
511507
&self.tcx.sess
512508
}
513509

514-
fn check_overflow(&self) -> bool {
515-
self.check_overflow
516-
}
517-
518510
fn codegen_unit(&self) -> &'tcx CodegenUnit<'tcx> {
519511
self.codegen_unit
520512
}

0 commit comments

Comments
 (0)