Add clif-util compile option to output object file (#5493)

* add clif-util compile option to output object file

* switch from a box to a borrow

* update objectmodule tests to use borrowed isa

* put targetisa into an arc
This commit is contained in:
Sam Sartor
2023-01-06 13:53:48 -07:00
committed by GitHub
parent 9156cca8ca
commit 1efa3d6f8b
15 changed files with 114 additions and 62 deletions

View File

@@ -8,7 +8,7 @@
use crate::error::{Location, ParseError};
use crate::testcommand::TestOption;
use cranelift_codegen::isa::TargetIsa;
use cranelift_codegen::isa::{OwnedTargetIsa, TargetIsa};
use cranelift_codegen::settings::{Configurable, Flags, SetError};
/// The ISA specifications in a `.clif` file.
@@ -19,7 +19,7 @@ pub enum IsaSpec {
/// The parsed file does contain `isa` commands.
/// Each `isa` command is used to configure a `TargetIsa` trait object.
Some(Vec<Box<dyn TargetIsa>>),
Some(Vec<OwnedTargetIsa>),
}
impl IsaSpec {

View File

@@ -43,7 +43,7 @@ mod testcommand;
mod testfile;
use anyhow::{Error, Result};
use cranelift_codegen::isa::{self, TargetIsa};
use cranelift_codegen::isa::{self, OwnedTargetIsa};
use cranelift_codegen::settings::{self, FlagsOrIsa};
use std::str::FromStr;
use target_lexicon::Triple;
@@ -52,7 +52,7 @@ use target_lexicon::Triple;
#[allow(missing_docs)]
pub enum OwnedFlagsOrIsa {
Flags(settings::Flags),
Isa(Box<dyn TargetIsa>),
Isa(OwnedTargetIsa),
}
impl OwnedFlagsOrIsa {