Implement reloc_names() for all targets.

This gets rid of the last TargetIsa method with a default
implementation.
This commit is contained in:
Jakob Stoklund Olesen
2017-05-11 17:58:11 -07:00
parent 663b50efcc
commit 4158c4e09c
5 changed files with 13 additions and 3 deletions

View File

@@ -4,3 +4,5 @@ use binemit::{CodeSink, bad_encoding};
use ir::{Function, Inst}; use ir::{Function, Inst};
include!(concat!(env!("OUT_DIR"), "/binemit-arm32.rs")); include!(concat!(env!("OUT_DIR"), "/binemit-arm32.rs"));
pub static RELOC_NAMES: [&'static str; 1] = ["Call"];

View File

@@ -94,4 +94,8 @@ impl TargetIsa for Isa {
fn emit_inst(&self, func: &ir::Function, inst: ir::Inst, sink: &mut CodeSink) { fn emit_inst(&self, func: &ir::Function, inst: ir::Inst, sink: &mut CodeSink) {
binemit::emit_inst(func, inst, sink) binemit::emit_inst(func, inst, sink)
} }
fn reloc_names(&self) -> &'static [&'static str] {
&binemit::RELOC_NAMES
}
} }

View File

@@ -4,3 +4,5 @@ use binemit::{CodeSink, bad_encoding};
use ir::{Function, Inst}; use ir::{Function, Inst};
include!(concat!(env!("OUT_DIR"), "/binemit-arm64.rs")); include!(concat!(env!("OUT_DIR"), "/binemit-arm64.rs"));
pub static RELOC_NAMES: [&'static str; 1] = ["Call"];

View File

@@ -87,4 +87,8 @@ impl TargetIsa for Isa {
fn emit_inst(&self, func: &ir::Function, inst: ir::Inst, sink: &mut CodeSink) { fn emit_inst(&self, func: &ir::Function, inst: ir::Inst, sink: &mut CodeSink) {
binemit::emit_inst(func, inst, sink) binemit::emit_inst(func, inst, sink)
} }
fn reloc_names(&self) -> &'static [&'static str] {
&binemit::RELOC_NAMES
}
} }

View File

@@ -210,7 +210,5 @@ pub trait TargetIsa {
/// ///
/// This array can be indexed by the contents of `binemit::Reloc` objects passed to a /// This array can be indexed by the contents of `binemit::Reloc` objects passed to a
/// `CodeSink`. /// `CodeSink`.
fn reloc_names(&self) -> &'static [&'static str] { fn reloc_names(&self) -> &'static [&'static str];
unimplemented!()
}
} }