about summary refs log tree commit diff
path: root/src/debuginfo
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2020-10-09 19:17:52 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2020-10-09 19:17:52 +0200
commitc352f91b40a3533d49cc1c1ef58f9e656409cce5 (patch)
tree7303f118bcd3e6755bf5c80ca1f625c635df055d /src/debuginfo
parente910a24d449028cbbb90e9e99c5b4e72642abd59 (diff)
downloadrust-c352f91b40a3533d49cc1c1ef58f9e656409cce5.tar.gz
rust-c352f91b40a3533d49cc1c1ef58f9e656409cce5.zip
Rustfmt
Diffstat (limited to 'src/debuginfo')
-rw-r--r--src/debuginfo/emit.rs50
-rw-r--r--src/debuginfo/unwind.rs3
2 files changed, 23 insertions, 30 deletions
diff --git a/src/debuginfo/emit.rs b/src/debuginfo/emit.rs
index 3ad52c2e873..cf8fee2b1d1 100644
--- a/src/debuginfo/emit.rs
+++ b/src/debuginfo/emit.rs
@@ -84,9 +84,8 @@ impl WriterRelocate {
             match reloc.name {
                 super::DebugRelocName::Section(_) => unreachable!(),
                 super::DebugRelocName::Symbol(sym) => {
-                    let addr = jit_product.lookup_func(
-                        cranelift_module::FuncId::from_u32(sym.try_into().unwrap()),
-                    );
+                    let addr = jit_product
+                        .lookup_func(cranelift_module::FuncId::from_u32(sym.try_into().unwrap()));
                     let val = (addr as u64 as i64 + reloc.addend) as u64;
                     self.writer
                         .write_udata_at(reloc.offset as usize, val, reloc.size)
@@ -163,12 +162,7 @@ impl Writer for WriterRelocate {
         self.write_udata_at(offset, 0, size)
     }
 
-    fn write_eh_pointer(
-        &mut self,
-        address: Address,
-        eh_pe: gimli::DwEhPe,
-        size: u8,
-    ) -> Result<()> {
+    fn write_eh_pointer(&mut self, address: Address, eh_pe: gimli::DwEhPe, size: u8) -> Result<()> {
         match address {
             // Address::Constant arm copied from gimli
             Address::Constant(val) => {
@@ -186,27 +180,25 @@ impl Writer for WriterRelocate {
                 };
                 self.write_eh_pointer_data(val, eh_pe.format(), size)
             }
-            Address::Symbol { symbol, addend } => {
-                match eh_pe.application() {
-                    gimli::DW_EH_PE_pcrel => {
-                        let size = match eh_pe.format() {
-                            gimli::DW_EH_PE_sdata4 => 4,
-                            _ => return Err(gimli::write::Error::UnsupportedPointerEncoding(eh_pe)),
-                        };
-                        self.relocs.push(DebugReloc {
-                            offset: self.len() as u32,
-                            size,
-                            name: DebugRelocName::Symbol(symbol),
-                            addend,
-                            kind: object::RelocationKind::Relative,
-                        });
-                        self.write_udata(0, size)
-                    }
-                    _ => {
-                        return Err(gimli::write::Error::UnsupportedPointerEncoding(eh_pe));
-                    }
+            Address::Symbol { symbol, addend } => match eh_pe.application() {
+                gimli::DW_EH_PE_pcrel => {
+                    let size = match eh_pe.format() {
+                        gimli::DW_EH_PE_sdata4 => 4,
+                        _ => return Err(gimli::write::Error::UnsupportedPointerEncoding(eh_pe)),
+                    };
+                    self.relocs.push(DebugReloc {
+                        offset: self.len() as u32,
+                        size,
+                        name: DebugRelocName::Symbol(symbol),
+                        addend,
+                        kind: object::RelocationKind::Relative,
+                    });
+                    self.write_udata(0, size)
                 }
-            }
+                _ => {
+                    return Err(gimli::write::Error::UnsupportedPointerEncoding(eh_pe));
+                }
+            },
         }
     }
 }
diff --git a/src/debuginfo/unwind.rs b/src/debuginfo/unwind.rs
index f08dfb60769..61ebd931d2f 100644
--- a/src/debuginfo/unwind.rs
+++ b/src/debuginfo/unwind.rs
@@ -20,7 +20,8 @@ impl<'tcx> UnwindContext<'tcx> {
 
         let cie_id = if let Some(mut cie) = isa.create_systemv_cie() {
             if isa.flags().is_pic() {
-                cie.fde_address_encoding = gimli::DwEhPe(gimli::DW_EH_PE_pcrel.0 | gimli::DW_EH_PE_sdata4.0);
+                cie.fde_address_encoding =
+                    gimli::DwEhPe(gimli::DW_EH_PE_pcrel.0 | gimli::DW_EH_PE_sdata4.0);
             }
             Some(frame_table.add_cie(cie))
         } else {