about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authortempdragon <645703113@qq.com>2024-02-28 11:37:49 +0800
committertempdragon <645703113@qq.com>2024-02-28 11:38:44 +0800
commit09fd9087b6ee5245e5b87fdb2dd48e7770c41fd6 (patch)
treeba2a0aed02d1eecdb02d8c196253aeb01a8dc393 /src
parent6170f48e3f5800a75e2ded5e55669048acfcbb2f (diff)
downloadrust-09fd9087b6ee5245e5b87fdb2dd48e7770c41fd6.tar.gz
rust-09fd9087b6ee5245e5b87fdb2dd48e7770c41fd6.zip
fix(code fmt): builder.rs & base.rs
Diffstat (limited to 'src')
-rw-r--r--src/base.rs4
-rw-r--r--src/builder.rs17
2 files changed, 5 insertions, 16 deletions
diff --git a/src/base.rs b/src/base.rs
index bcf467839a4..773e234150d 100644
--- a/src/base.rs
+++ b/src/base.rs
@@ -184,8 +184,8 @@ pub fn compile_codegen_unit(tcx: TyCtxt<'_>, cgu_name: Symbol, target_info: Lock
             // wrapper here
             maybe_create_entry_wrapper::<Builder<'_, '_, '_>>(&cx);
 
-            // FINALIZE debuginfo
-            if cx.sess().opts.debuginfo != DebugInfo::None  {
+            // Finalize debuginfo
+            if cx.sess().opts.debuginfo != DebugInfo::None {
                 cx.debuginfo_finalize();
             }
         }
diff --git a/src/builder.rs b/src/builder.rs
index 663e42aaf85..87b5b04af13 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -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> {