]> git.lizzy.rs Git - rust.git/commitdiff
Rustfmt
authorbjorn3 <bjorn3@users.noreply.github.com>
Fri, 25 Dec 2020 11:48:19 +0000 (12:48 +0100)
committerbjorn3 <bjorn3@users.noreply.github.com>
Fri, 25 Dec 2020 11:48:19 +0000 (12:48 +0100)
src/base.rs
src/constant.rs
src/debuginfo/emit.rs
src/pretty_clif.rs

index 5ba992d93724f78cdd08e34de6790688b4ac50f7..34c9561d6762287a6113ee700e4042e6041b4352 100644 (file)
@@ -144,9 +144,11 @@ pub(crate) fn codegen_fn<'tcx>(
 
     if let Some(mach_compile_result) = &context.mach_compile_result {
         if let Some(disasm) = &mach_compile_result.disasm {
-            crate::pretty_clif::write_ir_file(tcx, &format!("{}.vcode", tcx.symbol_name(instance).name), |file| {
-                file.write_all(disasm.as_bytes())
-            })
+            crate::pretty_clif::write_ir_file(
+                tcx,
+                &format!("{}.vcode", tcx.symbol_name(instance).name),
+                |file| file.write_all(disasm.as_bytes()),
+            )
         }
     }
 
index bfa2076d3d9695592589148afd5339cf9287cdb9..beff84fb2e217ae04445e7979f807ddebf7b65ab 100644 (file)
@@ -100,7 +100,10 @@ fn codegen_static_ref<'tcx>(
     let global_ptr = fx.bcx.ins().global_value(fx.pointer_type, local_data_id);
     assert!(!layout.is_unsized(), "unsized statics aren't supported");
     assert!(
-        matches!(fx.bcx.func.global_values[local_data_id], GlobalValueData::Symbol { tls: false, ..}),
+        matches!(
+            fx.bcx.func.global_values[local_data_id],
+            GlobalValueData::Symbol { tls: false, .. }
+        ),
         "tls static referenced without Rvalue::ThreadLocalRef"
     );
     CPlace::for_ptr(crate::pointer::Pointer::new(global_ptr), layout)
index 7a0d8907c5005713086db2c76ba4d12ab34d4a4f..6160f9b78d8b3a6d9cd3cefde854f4ca60813f67 100644 (file)
@@ -74,10 +74,7 @@ pub(super) fn new(endian: RunTimeEndian) -> Self {
 
     /// Perform the collected relocations to be usable for JIT usage.
     #[cfg(feature = "jit")]
-    pub(super) fn relocate_for_jit(
-        mut self,
-        jit_module: &cranelift_jit::JITModule,
-    ) -> Vec<u8> {
+    pub(super) fn relocate_for_jit(mut self, jit_module: &cranelift_jit::JITModule) -> Vec<u8> {
         use std::convert::TryInto;
 
         for reloc in self.relocs.drain(..) {
index 1326bac74b1da86a60161d7476c9b51ac2ee0db5..22c94fec82fc13a61b03ff1063376ecef26f652d 100644 (file)
@@ -246,37 +246,37 @@ pub(crate) fn write_clif_file<'tcx>(
     context: &cranelift_codegen::Context,
     mut clif_comments: &CommentWriter,
 ) {
-    write_ir_file(tcx, &format!(
-        "{}.{}.clif",
-        tcx.symbol_name(instance).name,
-        postfix
-    ), |file| {
-        let value_ranges = isa.map(|isa| {
-            context
-                .build_value_labels_ranges(isa)
-                .expect("value location ranges")
-        });
+    write_ir_file(
+        tcx,
+        &format!("{}.{}.clif", tcx.symbol_name(instance).name, postfix),
+        |file| {
+            let value_ranges = isa.map(|isa| {
+                context
+                    .build_value_labels_ranges(isa)
+                    .expect("value location ranges")
+            });
 
-        let mut clif = String::new();
-        cranelift_codegen::write::decorate_function(
-            &mut clif_comments,
-            &mut clif,
-            &context.func,
-            &DisplayFunctionAnnotations {
-                isa: Some(&*crate::build_isa(tcx.sess)),
-                value_ranges: value_ranges.as_ref(),
-            },
-        )
-        .unwrap();
+            let mut clif = String::new();
+            cranelift_codegen::write::decorate_function(
+                &mut clif_comments,
+                &mut clif,
+                &context.func,
+                &DisplayFunctionAnnotations {
+                    isa: Some(&*crate::build_isa(tcx.sess)),
+                    value_ranges: value_ranges.as_ref(),
+                },
+            )
+            .unwrap();
 
-        writeln!(file, "test compile")?;
-        writeln!(file, "set is_pic")?;
-        writeln!(file, "set enable_simd")?;
-        writeln!(file, "target {} haswell", crate::target_triple(tcx.sess))?;
-        writeln!(file)?;
-        file.write_all(clif.as_bytes())?;
-        Ok(())
-    });
+            writeln!(file, "test compile")?;
+            writeln!(file, "set is_pic")?;
+            writeln!(file, "set enable_simd")?;
+            writeln!(file, "target {} haswell", crate::target_triple(tcx.sess))?;
+            writeln!(file)?;
+            file.write_all(clif.as_bytes())?;
+            Ok(())
+        },
+    );
 }
 
 impl<M: Module> fmt::Debug for FunctionCx<'_, '_, M> {