fix(code fmt): builder.rs & base.rs

This commit is contained in:
tempdragon 2024-02-28 11:37:49 +08:00
parent 6170f48e3f
commit 09fd9087b6
2 changed files with 5 additions and 16 deletions

View File

@ -184,7 +184,7 @@ pub fn compile_codegen_unit(tcx: TyCtxt<'_>, cgu_name: Symbol, target_info: Lock
// wrapper here
maybe_create_entry_wrapper::<Builder<'_, '_, '_>>(&cx);
// FINALIZE debuginfo
// Finalize debuginfo
if cx.sess().opts.debuginfo != DebugInfo::None {
cx.debuginfo_finalize();
}

View File

@ -70,7 +70,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
cx,
block,
stack_var_count: Cell::new(0),
loc:None
loc: None
}
}
@ -541,12 +541,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
}
fn fmul(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {
let i=a * b;
if self.loc.is_some() {
#[cfg(feature = "master")]
i.set_location(self.loc.clone().unwrap());
}
i
self.cx.context.new_binary_op(self.loc, BinaryOp::Mult, a.get_type(), a, b)
}
fn udiv(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {
@ -660,13 +655,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
}
fn or(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {
let ret = self.cx.gcc_or(a, b, self.loc);
if self.loc.is_some() {
#[cfg(feature = "master")]
ret.set_location(self.loc.unwrap());
}
ret
self.cx.gcc_or(a, b, self.loc)
}
fn xor(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {