1
Fork 0

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

View file

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