diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2021-02-09 13:47:29 +0100 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2021-02-18 18:07:25 +0100 |
| commit | 92f765fce96b6344ccfe9b288bbd8b652f5ad0ef (patch) | |
| tree | 3c5571ae615b4c571d0bc4bb97e298c4b0acca14 /src | |
| parent | c39cb46da7a51c92f1911d4df5f4bab6450cd0c7 (diff) | |
| download | rust-92f765fce96b6344ccfe9b288bbd8b652f5ad0ef.tar.gz rust-92f765fce96b6344ccfe9b288bbd8b652f5ad0ef.zip | |
Remove support for x86 oldBE
Diffstat (limited to 'src')
| -rw-r--r-- | src/base.rs | 14 | ||||
| -rw-r--r-- | src/debuginfo/line_info.rs | 49 | ||||
| -rw-r--r-- | src/debuginfo/mod.rs | 7 | ||||
| -rw-r--r-- | src/lib.rs | 6 |
4 files changed, 21 insertions, 55 deletions
diff --git a/src/base.rs b/src/base.rs index 4842628a99d..03889a4687f 100644 --- a/src/base.rs +++ b/src/base.rs @@ -149,14 +149,12 @@ pub(crate) fn codegen_fn<'tcx>( &clif_comments, ); - 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()), - ) - } + if let Some(disasm) = &context.mach_compile_result.as_ref().unwrap().disasm { + crate::pretty_clif::write_ir_file( + tcx, + &format!("{}.vcode", tcx.symbol_name(instance).name), + |file| file.write_all(disasm.as_bytes()), + ) } // Define debuginfo for function diff --git a/src/debuginfo/line_info.rs b/src/debuginfo/line_info.rs index d226755d85d..a40f963400c 100644 --- a/src/debuginfo/line_info.rs +++ b/src/debuginfo/line_info.rs @@ -129,7 +129,6 @@ impl<'tcx> DebugContext<'tcx> { pub(super) fn create_debug_lines( &mut self, - isa: &dyn cranelift_codegen::isa::TargetIsa, symbol: usize, entry_id: UnitEntryId, context: &Context, @@ -138,7 +137,6 @@ impl<'tcx> DebugContext<'tcx> { ) -> CodeOffset { let tcx = self.tcx; let line_program = &mut self.dwarf.unit.line_program; - let func = &context.func; let line_strings = &mut self.dwarf.line_strings; let mut last_span = None; @@ -202,43 +200,22 @@ impl<'tcx> DebugContext<'tcx> { let mut func_end = 0; - if let Some(ref mcr) = &context.mach_compile_result { - for &MachSrcLoc { start, end, loc } in mcr.buffer.get_srclocs_sorted() { - line_program.row().address_offset = u64::from(start); - if !loc.is_default() { - let source_info = *source_info_set.get_index(loc.bits() as usize).unwrap(); - create_row_for_span(line_program, source_info.span); - } else { - create_row_for_span(line_program, function_span); - } - func_end = end; - } - - line_program.end_sequence(u64::from(func_end)); - - func_end = mcr.buffer.total_size(); - } else { - let encinfo = isa.encoding_info(); - let mut blocks = func.layout.blocks().collect::<Vec<_>>(); - blocks.sort_by_key(|block| func.offsets[*block]); // Ensure inst offsets always increase - - for block in blocks { - for (offset, inst, size) in func.inst_offsets(block, &encinfo) { - let srcloc = func.srclocs[inst]; - line_program.row().address_offset = u64::from(offset); - if !srcloc.is_default() { - let source_info = - *source_info_set.get_index(srcloc.bits() as usize).unwrap(); - create_row_for_span(line_program, source_info.span); - } else { - create_row_for_span(line_program, function_span); - } - func_end = offset + size; - } + let mcr = context.mach_compile_result.as_ref().unwrap(); + for &MachSrcLoc { start, end, loc } in mcr.buffer.get_srclocs_sorted() { + line_program.row().address_offset = u64::from(start); + if !loc.is_default() { + let source_info = *source_info_set.get_index(loc.bits() as usize).unwrap(); + create_row_for_span(line_program, source_info.span); + } else { + create_row_for_span(line_program, function_span); } - line_program.end_sequence(u64::from(func_end)); + func_end = end; } + line_program.end_sequence(u64::from(func_end)); + + let func_end = mcr.buffer.total_size(); + assert_ne!(func_end, 0); let entry = self.dwarf.unit.get_mut(entry_id); diff --git a/src/debuginfo/mod.rs b/src/debuginfo/mod.rs index 97704903b96..87b1c5fb50e 100644 --- a/src/debuginfo/mod.rs +++ b/src/debuginfo/mod.rs @@ -252,18 +252,13 @@ impl<'tcx> DebugContext<'tcx> { AttributeValue::StringRef(name_id), ); - let end = - self.create_debug_lines(isa, symbol, entry_id, context, mir.span, source_info_set); + let end = self.create_debug_lines(symbol, entry_id, context, mir.span, source_info_set); self.unit_range_list.0.push(Range::StartLength { begin: Address::Symbol { symbol, addend: 0 }, length: u64::from(end), }); - if isa.get_mach_backend().is_some() { - return; // Not yet implemented for the AArch64 backend. - } - let func_entry = self.dwarf.unit.get_mut(entry_id); // Gdb requires both DW_AT_low_pc and DW_AT_high_pc. Otherwise the DW_TAG_subprogram is skipped. func_entry.set( diff --git a/src/lib.rs b/src/lib.rs index 119716268c1..f081a2d85a9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -343,11 +343,7 @@ fn build_isa(sess: &Session) -> Box<dyn isa::TargetIsa + 'static> { let flags = settings::Flags::new(flags_builder); - let variant = if cfg!(feature = "oldbe") { - cranelift_codegen::isa::BackendVariant::Legacy - } else { - cranelift_codegen::isa::BackendVariant::MachInst - }; + let variant = cranelift_codegen::isa::BackendVariant::MachInst; let mut isa_builder = cranelift_codegen::isa::lookup_variant(target_triple, variant).unwrap(); // Don't use "haswell", as it implies `has_lzcnt`.macOS CI is still at Ivy Bridge EP, so `lzcnt` // is interpreted as `bsr`. |
