Remove check_overflow method from MiscMethods

It can be retrieved from the Session too.
This commit is contained in:
bjorn3 2024-03-30 14:25:13 +00:00
parent 9d25e851ce
commit 8a1e58169a

View File

@ -27,7 +27,6 @@
use crate::common::SignType;
pub struct CodegenCx<'gcc, 'tcx> {
pub check_overflow: bool,
pub codegen_unit: &'tcx CodegenUnit<'tcx>,
pub context: &'gcc Context<'gcc>,
@ -134,8 +133,6 @@ pub fn new(
tcx: TyCtxt<'tcx>,
supports_128bit_integers: bool,
) -> Self {
let check_overflow = tcx.sess.overflow_checks();
let create_type = |ctype, rust_type| {
let layout = tcx.layout_of(ParamEnv::reveal_all().and(rust_type)).unwrap();
let align = layout.align.abi.bytes();
@ -271,7 +268,6 @@ pub fn new(
}
let mut cx = Self {
check_overflow,
codegen_unit,
context,
current_func: RefCell::new(None),
@ -511,10 +507,6 @@ fn sess(&self) -> &Session {
&self.tcx.sess
}
fn check_overflow(&self) -> bool {
self.check_overflow
}
fn codegen_unit(&self) -> &'tcx CodegenUnit<'tcx> {
self.codegen_unit
}