|
|
@ -14,16 +14,13 @@ use target_lexicon::Triple; |
|
|
|
/// A wrapper around a `MachBackend` that provides a `TargetIsa` impl.
|
|
|
|
pub struct TargetIsaAdapter { |
|
|
|
backend: Box<dyn MachBackend + Send + Sync + 'static>, |
|
|
|
triple: Triple, |
|
|
|
} |
|
|
|
|
|
|
|
impl TargetIsaAdapter { |
|
|
|
/// Create a new `TargetIsa` wrapper around a `MachBackend`.
|
|
|
|
pub fn new<B: MachBackend + Send + Sync + 'static>(backend: B) -> TargetIsaAdapter { |
|
|
|
let triple = backend.triple(); |
|
|
|
TargetIsaAdapter { |
|
|
|
backend: Box::new(backend), |
|
|
|
triple, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -44,7 +41,7 @@ impl TargetIsa for TargetIsaAdapter { |
|
|
|
} |
|
|
|
|
|
|
|
fn triple(&self) -> &Triple { |
|
|
|
&self.triple |
|
|
|
self.backend.triple() |
|
|
|
} |
|
|
|
|
|
|
|
fn flags(&self) -> &Flags { |
|
|
|