Skip to content

Commit 09fd908

Browse files
committed
fix(code fmt): builder.rs & base.rs
1 parent 6170f48 commit 09fd908

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

src/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ pub fn compile_codegen_unit(tcx: TyCtxt<'_>, cgu_name: Symbol, target_info: Lock
184184
// wrapper here
185185
maybe_create_entry_wrapper::<Builder<'_, '_, '_>>(&cx);
186186

187-
// FINALIZE debuginfo
188-
if cx.sess().opts.debuginfo != DebugInfo::None {
187+
// Finalize debuginfo
188+
if cx.sess().opts.debuginfo != DebugInfo::None {
189189
cx.debuginfo_finalize();
190190
}
191191
}

src/builder.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
7070
cx,
7171
block,
7272
stack_var_count: Cell::new(0),
73-
loc:None
73+
loc: None
7474
}
7575
}
7676

@@ -541,12 +541,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
541541
}
542542

543543
fn fmul(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {
544-
let i=a * b;
545-
if self.loc.is_some() {
546-
#[cfg(feature = "master")]
547-
i.set_location(self.loc.clone().unwrap());
548-
}
549-
i
544+
self.cx.context.new_binary_op(self.loc, BinaryOp::Mult, a.get_type(), a, b)
550545
}
551546

552547
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> {
660655
}
661656

662657
fn or(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {
663-
let ret = self.cx.gcc_or(a, b, self.loc);
664-
665-
if self.loc.is_some() {
666-
#[cfg(feature = "master")]
667-
ret.set_location(self.loc.unwrap());
668-
}
669-
ret
658+
self.cx.gcc_or(a, b, self.loc)
670659
}
671660

672661
fn xor(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {

0 commit comments

Comments
 (0)