about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2021-02-09 13:47:29 +0100
committerbjorn3 <bjorn3@users.noreply.github.com>2021-02-18 18:07:25 +0100
commit92f765fce96b6344ccfe9b288bbd8b652f5ad0ef (patch)
tree3c5571ae615b4c571d0bc4bb97e298c4b0acca14
parentc39cb46da7a51c92f1911d4df5f4bab6450cd0c7 (diff)
downloadrust-92f765fce96b6344ccfe9b288bbd8b652f5ad0ef.tar.gz
rust-92f765fce96b6344ccfe9b288bbd8b652f5ad0ef.zip
Remove support for x86 oldBE
-rw-r--r--.github/workflows/main.yml5
-rw-r--r--Cargo.toml3
-rwxr-xr-xbuild.sh10
-rw-r--r--src/base.rs14
-rw-r--r--src/debuginfo/line_info.rs49
-rw-r--r--src/debuginfo/mod.rs7
-rw-r--r--src/lib.rs6
7 files changed, 26 insertions, 68 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 20c58423a0c..e6d3375fb1b 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -12,9 +12,6 @@ jobs:
       fail-fast: false
       matrix:
         os: [ubuntu-latest, macos-latest]
-        env:
-          - BACKEND: ""
-          - BACKEND: --oldbe
 
     steps:
     - uses: actions/checkout@v2
@@ -54,7 +51,7 @@ jobs:
         export COMPILE_RUNS=2
         export RUN_RUNS=2
 
-        ./test.sh $BACKEND
+        ./test.sh
 
     - name: Package prebuilt cg_clif
       run: tar cvfJ cg_clif.tar.xz build
diff --git a/Cargo.toml b/Cargo.toml
index 41e23b51afa..9861af1f8ea 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,7 +9,7 @@ crate-type = ["dylib"]
 
 [dependencies]
 # These have to be in sync with each other
-cranelift-codegen = { git = "https://github.com/bytecodealliance/wasmtime/", branch = "main", features = ["unwind", "x86", "x64"] }
+cranelift-codegen = { git = "https://github.com/bytecodealliance/wasmtime/", branch = "main", features = ["unwind", "x64"] }
 cranelift-frontend = { git = "https://github.com/bytecodealliance/wasmtime/", branch = "main" }
 cranelift-module = { git = "https://github.com/bytecodealliance/wasmtime/", branch = "main" }
 cranelift-jit = { git = "https://github.com/bytecodealliance/wasmtime/", branch = "main", optional = true }
@@ -38,7 +38,6 @@ smallvec = "1.6.1"
 default = ["jit", "inline_asm"]
 jit = ["cranelift-jit", "libloading"]
 inline_asm = []
-oldbe = []
 
 [profile.dev]
 # By compiling dependencies with optimizations, performing tests gets much faster.
diff --git a/build.sh b/build.sh
index 52bc21d0a17..090349e54b1 100755
--- a/build.sh
+++ b/build.sh
@@ -5,7 +5,6 @@ set -e
 export CHANNEL="release"
 build_sysroot="clif"
 target_dir='build'
-oldbe=''
 while [[ $# != 0 ]]; do
     case $1 in
         "--debug")
@@ -19,12 +18,9 @@ while [[ $# != 0 ]]; do
             target_dir=$2
             shift
             ;;
-        "--oldbe")
-            oldbe='--features oldbe'
-            ;;
         *)
             echo "Unknown flag '$1'"
-            echo "Usage: ./build.sh [--debug] [--sysroot none|clif|llvm] [--target-dir DIR] [--oldbe]"
+            echo "Usage: ./build.sh [--debug] [--sysroot none|clif|llvm] [--target-dir DIR]"
             exit 1
             ;;
     esac
@@ -44,9 +40,9 @@ else
    exit 1
 fi
 if [[ "$CHANNEL" == "release" ]]; then
-    cargo build $oldbe --release
+    cargo build --release
 else
-    cargo build $oldbe
+    cargo build
 fi
 
 source scripts/ext_config.sh
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`.