Merge remote-tracking branch 'origin/master' into no_std
This commit is contained in:
@@ -23,7 +23,7 @@ cretonne-module = { path = "lib/module", version = "0.5.1" }
|
|||||||
cretonne-faerie = { path = "lib/faerie", version = "0.5.1" }
|
cretonne-faerie = { path = "lib/faerie", version = "0.5.1" }
|
||||||
cretonne-simplejit = { path = "lib/simplejit", version = "0.5.1" }
|
cretonne-simplejit = { path = "lib/simplejit", version = "0.5.1" }
|
||||||
cretonne = { path = "lib/umbrella", version = "0.5.1" }
|
cretonne = { path = "lib/umbrella", version = "0.5.1" }
|
||||||
filecheck = "0.2.1"
|
filecheck = "0.3.0"
|
||||||
docopt = "0.8.0"
|
docopt = "0.8.0"
|
||||||
serde = "1.0.8"
|
serde = "1.0.8"
|
||||||
serde_derive = "1.0.8"
|
serde_derive = "1.0.8"
|
||||||
@@ -31,11 +31,3 @@ tempdir = "0.3.5"
|
|||||||
term = "0.5.1"
|
term = "0.5.1"
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
|
|
||||||
# Enable debug assertions and parallel compilation when building cretonne-tools
|
|
||||||
# since they are for testing and development mostly. This doesn't affect the
|
|
||||||
# flags used to build the cretonne-* crates when used as a dependency.
|
|
||||||
[profile.release]
|
|
||||||
opt-level = 2
|
|
||||||
debug-assertions = true
|
|
||||||
codegen-units = 4
|
|
||||||
|
|||||||
@@ -41,15 +41,17 @@ if [ -n "$needcheck" ]; then
|
|||||||
touch $tsfile || echo no target directory
|
touch $tsfile || echo no target directory
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Make sure the code builds in release mode.
|
||||||
|
banner "Rust release build"
|
||||||
|
cargo build --release
|
||||||
|
|
||||||
# Make sure the code builds in debug mode.
|
# Make sure the code builds in debug mode.
|
||||||
banner "Rust debug build"
|
banner "Rust debug build"
|
||||||
cargo build
|
cargo build
|
||||||
|
|
||||||
# Make sure the code builds in release mode, and run the unit tests. We run
|
# Run the tests. We run these in debug mode so that assertions are enabled.
|
||||||
# these in release mode for speed, but note that the top-level Cargo.toml file
|
banner "Rust unit tests"
|
||||||
# does enable debug assertions in release builds.
|
cargo test --all
|
||||||
banner "Rust release build and unit tests"
|
|
||||||
cargo test --all --release
|
|
||||||
|
|
||||||
# Make sure the documentation builds.
|
# Make sure the documentation builds.
|
||||||
banner "Rust documentation: $topdir/target/doc/cretonne/index.html"
|
banner "Rust documentation: $topdir/target/doc/cretonne/index.html"
|
||||||
|
|||||||
@@ -68,6 +68,9 @@ pub trait RelocSink {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// A trait for receiving trap codes and offsets.
|
/// A trait for receiving trap codes and offsets.
|
||||||
|
///
|
||||||
|
/// If you don't need information about possible traps, you can use the
|
||||||
|
/// [`NullTrapSink`](binemit/trait.TrapSink.html) implementation.
|
||||||
pub trait TrapSink {
|
pub trait TrapSink {
|
||||||
/// Add trap information for a specific offset.
|
/// Add trap information for a specific offset.
|
||||||
fn trap(&mut self, CodeOffset, SourceLoc, TrapCode);
|
fn trap(&mut self, CodeOffset, SourceLoc, TrapCode);
|
||||||
|
|||||||
@@ -11,19 +11,18 @@ use failure::Error;
|
|||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use target;
|
use target;
|
||||||
|
|
||||||
pub struct FaerieCompiledFunction {}
|
/// A builder for `FaerieBackend`.
|
||||||
|
pub struct FaerieBuilder {
|
||||||
pub struct FaerieCompiledData {}
|
|
||||||
|
|
||||||
/// A `FaerieBackend` implements `Backend` and emits ".o" files using the `faerie` library.
|
|
||||||
pub struct FaerieBackend {
|
|
||||||
isa: Box<TargetIsa>,
|
isa: Box<TargetIsa>,
|
||||||
artifact: faerie::Artifact,
|
name: String,
|
||||||
format: container::Format,
|
format: container::Format,
|
||||||
|
faerie_target: faerie::Target,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FaerieBackend {
|
impl FaerieBuilder {
|
||||||
/// Create a new `FaerieBackend` using the given Cretonne target.
|
/// Create a new `FaerieBuilder` using the given Cretonne target, that
|
||||||
|
/// can be passed to
|
||||||
|
/// [`Module::new`](cretonne_module/struct.Module.html#method.new].
|
||||||
pub fn new(
|
pub fn new(
|
||||||
isa: Box<TargetIsa>,
|
isa: Box<TargetIsa>,
|
||||||
name: String,
|
name: String,
|
||||||
@@ -33,34 +32,27 @@ impl FaerieBackend {
|
|||||||
let faerie_target = target::translate(&*isa)?;
|
let faerie_target = target::translate(&*isa)?;
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
isa,
|
isa,
|
||||||
artifact: faerie::Artifact::new(faerie_target, name),
|
name,
|
||||||
format,
|
format,
|
||||||
|
faerie_target,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return the name of the output file. This is the name passed into `new`.
|
|
||||||
pub fn name(&self) -> &str {
|
|
||||||
&self.artifact.name
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Call `emit` on the faerie `Artifact`, producing bytes in memory.
|
|
||||||
pub fn emit(&self) -> Result<Vec<u8>, Error> {
|
|
||||||
match self.format {
|
|
||||||
container::Format::ELF => self.artifact.emit::<faerie::Elf>(),
|
|
||||||
container::Format::MachO => self.artifact.emit::<faerie::Mach>(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Call `write` on the faerie `Artifact`, writing to a file.
|
|
||||||
pub fn write(&self, sink: File) -> Result<(), Error> {
|
|
||||||
match self.format {
|
|
||||||
container::Format::ELF => self.artifact.write::<faerie::Elf>(sink),
|
|
||||||
container::Format::MachO => self.artifact.write::<faerie::Mach>(sink),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A `FaerieBackend` implements `Backend` and emits ".o" files using the `faerie` library.
|
||||||
|
pub struct FaerieBackend {
|
||||||
|
isa: Box<TargetIsa>,
|
||||||
|
artifact: faerie::Artifact,
|
||||||
|
format: container::Format,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct FaerieCompiledFunction {}
|
||||||
|
|
||||||
|
pub struct FaerieCompiledData {}
|
||||||
|
|
||||||
impl Backend for FaerieBackend {
|
impl Backend for FaerieBackend {
|
||||||
|
type Builder = FaerieBuilder;
|
||||||
|
|
||||||
type CompiledFunction = FaerieCompiledFunction;
|
type CompiledFunction = FaerieCompiledFunction;
|
||||||
type CompiledData = FaerieCompiledData;
|
type CompiledData = FaerieCompiledData;
|
||||||
|
|
||||||
@@ -69,6 +61,19 @@ impl Backend for FaerieBackend {
|
|||||||
type FinalizedFunction = ();
|
type FinalizedFunction = ();
|
||||||
type FinalizedData = ();
|
type FinalizedData = ();
|
||||||
|
|
||||||
|
/// The returned value here provides functions for emitting object files
|
||||||
|
/// to memory and files.
|
||||||
|
type Product = FaerieProduct;
|
||||||
|
|
||||||
|
/// Create a new `FaerieBackend` using the given Cretonne target.
|
||||||
|
fn new(builder: FaerieBuilder) -> Self {
|
||||||
|
Self {
|
||||||
|
isa: builder.isa,
|
||||||
|
artifact: faerie::Artifact::new(builder.faerie_target, builder.name),
|
||||||
|
format: builder.format,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn isa(&self) -> &TargetIsa {
|
fn isa(&self) -> &TargetIsa {
|
||||||
&*self.isa
|
&*self.isa
|
||||||
}
|
}
|
||||||
@@ -216,6 +221,44 @@ impl Backend for FaerieBackend {
|
|||||||
fn finalize_data(&mut self, _data: &FaerieCompiledData, _namespace: &ModuleNamespace<Self>) {
|
fn finalize_data(&mut self, _data: &FaerieCompiledData, _namespace: &ModuleNamespace<Self>) {
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn finish(self) -> FaerieProduct {
|
||||||
|
FaerieProduct {
|
||||||
|
artifact: self.artifact,
|
||||||
|
format: self.format,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// This is the output of `Module`'s
|
||||||
|
/// [`finish`](../cretonne_module/struct.Module.html#method.finish) function.
|
||||||
|
/// It provides functions for writing out the object file to memory or a file.
|
||||||
|
pub struct FaerieProduct {
|
||||||
|
artifact: faerie::Artifact,
|
||||||
|
format: container::Format,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl FaerieProduct {
|
||||||
|
/// Return the name of the output file. This is the name passed into `new`.
|
||||||
|
pub fn name(&self) -> &str {
|
||||||
|
&self.artifact.name
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Call `emit` on the faerie `Artifact`, producing bytes in memory.
|
||||||
|
pub fn emit(&self) -> Result<Vec<u8>, Error> {
|
||||||
|
match self.format {
|
||||||
|
container::Format::ELF => self.artifact.emit::<faerie::Elf>(),
|
||||||
|
container::Format::MachO => self.artifact.emit::<faerie::Mach>(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Call `write` on the faerie `Artifact`, writing to a file.
|
||||||
|
pub fn write(&self, sink: File) -> Result<(), Error> {
|
||||||
|
match self.format {
|
||||||
|
container::Format::ELF => self.artifact.write::<faerie::Elf>(sink),
|
||||||
|
container::Format::MachO => self.artifact.write::<faerie::Mach>(sink),
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn translate_function_linkage(linkage: Linkage) -> faerie::Decl {
|
fn translate_function_linkage(linkage: Linkage) -> faerie::Decl {
|
||||||
|
|||||||
@@ -29,5 +29,5 @@ mod backend;
|
|||||||
mod container;
|
mod container;
|
||||||
mod target;
|
mod target;
|
||||||
|
|
||||||
pub use backend::FaerieBackend;
|
pub use backend::{FaerieBuilder, FaerieBackend};
|
||||||
pub use container::Format;
|
pub use container::Format;
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ pub trait Backend
|
|||||||
where
|
where
|
||||||
Self: marker::Sized,
|
Self: marker::Sized,
|
||||||
{
|
{
|
||||||
|
/// A builder for constructing `Backend` instances.
|
||||||
|
type Builder;
|
||||||
|
|
||||||
/// The results of compiling a function.
|
/// The results of compiling a function.
|
||||||
type CompiledFunction;
|
type CompiledFunction;
|
||||||
|
|
||||||
@@ -21,13 +24,21 @@ where
|
|||||||
type CompiledData;
|
type CompiledData;
|
||||||
|
|
||||||
/// The completed output artifact for a function, if this is meaningful for
|
/// The completed output artifact for a function, if this is meaningful for
|
||||||
/// the Backend.
|
/// the `Backend`.
|
||||||
type FinalizedFunction;
|
type FinalizedFunction;
|
||||||
|
|
||||||
/// The completed output artifact for a data object, if this is meaningful for
|
/// The completed output artifact for a data object, if this is meaningful for
|
||||||
/// the Backend.
|
/// the `Backend`.
|
||||||
type FinalizedData;
|
type FinalizedData;
|
||||||
|
|
||||||
|
/// This is an object returned by `Module`'s
|
||||||
|
/// [`finish`](struct.Module.html#method.finish) function,
|
||||||
|
/// if the `Backend` has a purpose for this.
|
||||||
|
type Product;
|
||||||
|
|
||||||
|
/// Create a new `Backend` instance.
|
||||||
|
fn new(Self::Builder) -> Self;
|
||||||
|
|
||||||
/// Return the `TargetIsa` to compile for.
|
/// Return the `TargetIsa` to compile for.
|
||||||
fn isa(&self) -> &TargetIsa;
|
fn isa(&self) -> &TargetIsa;
|
||||||
|
|
||||||
@@ -94,4 +105,8 @@ where
|
|||||||
data: &Self::CompiledData,
|
data: &Self::CompiledData,
|
||||||
namespace: &ModuleNamespace<Self>,
|
namespace: &ModuleNamespace<Self>,
|
||||||
) -> Self::FinalizedData;
|
) -> Self::FinalizedData;
|
||||||
|
|
||||||
|
/// Consume this `Backend` and return a result. Some implementations may
|
||||||
|
/// provide additional functionality through this result.
|
||||||
|
fn finish(self) -> Self::Product;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ mod tests {
|
|||||||
fn basic_data_context() {
|
fn basic_data_context() {
|
||||||
let mut data_ctx = DataContext::new();
|
let mut data_ctx = DataContext::new();
|
||||||
{
|
{
|
||||||
let description = data_ctx.description();
|
let description = &data_ctx.description;
|
||||||
assert_eq!(description.writable, Writability::Readonly);
|
assert_eq!(description.writable, Writability::Readonly);
|
||||||
assert_eq!(description.init, Init::Uninitialized);
|
assert_eq!(description.init, Init::Uninitialized);
|
||||||
assert!(description.function_decls.is_empty());
|
assert!(description.function_decls.is_empty());
|
||||||
@@ -177,7 +177,7 @@ mod tests {
|
|||||||
|
|
||||||
data_ctx.clear();
|
data_ctx.clear();
|
||||||
{
|
{
|
||||||
let description = data_ctx.description();
|
let description = &data_ctx.description;
|
||||||
assert_eq!(description.writable, Writability::Readonly);
|
assert_eq!(description.writable, Writability::Readonly);
|
||||||
assert_eq!(description.init, Init::Uninitialized);
|
assert_eq!(description.init, Init::Uninitialized);
|
||||||
assert!(description.function_decls.is_empty());
|
assert!(description.function_decls.is_empty());
|
||||||
|
|||||||
@@ -236,14 +236,14 @@ where
|
|||||||
B: Backend,
|
B: Backend,
|
||||||
{
|
{
|
||||||
/// Create a new `Module`.
|
/// Create a new `Module`.
|
||||||
pub fn new(backend: B) -> Self {
|
pub fn new(backend_builder: B::Builder) -> Self {
|
||||||
Self {
|
Self {
|
||||||
names: HashMap::new(),
|
names: HashMap::new(),
|
||||||
contents: ModuleContents {
|
contents: ModuleContents {
|
||||||
functions: PrimaryMap::new(),
|
functions: PrimaryMap::new(),
|
||||||
data_objects: PrimaryMap::new(),
|
data_objects: PrimaryMap::new(),
|
||||||
},
|
},
|
||||||
backend,
|
backend: B::new(backend_builder),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -532,10 +532,10 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Consume the module and return its contained `Backend`. Some `Backend`
|
/// Consume the module and return the resulting `Product`. Some `Backend`
|
||||||
/// implementations have additional features not available through the
|
/// implementations may provide additional functionality available after
|
||||||
/// `Module` interface.
|
/// a `Module` is complete.
|
||||||
pub fn consume(self) -> B {
|
pub fn finish(self) -> B::Product {
|
||||||
self.backend
|
self.backend.finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,43 @@ use std::ptr;
|
|||||||
use libc;
|
use libc;
|
||||||
use memory::Memory;
|
use memory::Memory;
|
||||||
|
|
||||||
|
/// A builder for `SimpleJITBackend`.
|
||||||
|
pub struct SimpleJITBuilder {
|
||||||
|
isa: Box<TargetIsa>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl SimpleJITBuilder {
|
||||||
|
/// Create a new `SimpleJITBuilder`.
|
||||||
|
pub fn new() -> Self {
|
||||||
|
let (flag_builder, isa_builder) = cretonne_native::builders().unwrap_or_else(|_| {
|
||||||
|
panic!("host machine is not a supported target");
|
||||||
|
});
|
||||||
|
let isa = isa_builder.finish(settings::Flags::new(&flag_builder));
|
||||||
|
Self::with_isa(isa)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Create a new `SimpleJITBuilder` with an arbitrary target. This is mainly
|
||||||
|
/// useful for testing.
|
||||||
|
///
|
||||||
|
/// SimpleJIT requires a `TargetIsa` configured for non-PIC.
|
||||||
|
///
|
||||||
|
/// To create a `SimpleJITBuilder` for native use, use the `new` constructor
|
||||||
|
/// instead.
|
||||||
|
pub fn with_isa(isa: Box<TargetIsa>) -> Self {
|
||||||
|
debug_assert!(!isa.flags().is_pic(), "SimpleJIT requires non-PIC code");
|
||||||
|
Self { isa }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A `SimpleJITBackend` implements `Backend` and emits code and data into memory where it can be
|
||||||
|
/// directly called and accessed.
|
||||||
|
pub struct SimpleJITBackend {
|
||||||
|
isa: Box<TargetIsa>,
|
||||||
|
code_memory: Memory,
|
||||||
|
readonly_memory: Memory,
|
||||||
|
writable_memory: Memory,
|
||||||
|
}
|
||||||
|
|
||||||
/// A record of a relocation to perform.
|
/// A record of a relocation to perform.
|
||||||
struct RelocRecord {
|
struct RelocRecord {
|
||||||
offset: CodeOffset,
|
offset: CodeOffset,
|
||||||
@@ -32,49 +69,34 @@ pub struct SimpleJITCompiledData {
|
|||||||
relocs: Vec<RelocRecord>,
|
relocs: Vec<RelocRecord>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A `SimpleJITBackend` implements `Backend` and emits code and data into memory where it can be
|
impl<'simple_jit_backend> Backend for SimpleJITBackend {
|
||||||
/// directly called and accessed.
|
type Builder = SimpleJITBuilder;
|
||||||
pub struct SimpleJITBackend {
|
|
||||||
isa: Box<TargetIsa>,
|
/// SimpleJIT compiled function and data objects may have outstanding
|
||||||
code_memory: Memory,
|
/// relocations that need to be performed before the memory can be used.
|
||||||
readonly_memory: Memory,
|
/// These relocations are performed within `finalize_function` and
|
||||||
writable_memory: Memory,
|
/// `finalize_data`.
|
||||||
}
|
type CompiledFunction = SimpleJITCompiledFunction;
|
||||||
|
type CompiledData = SimpleJITCompiledData;
|
||||||
|
|
||||||
|
/// SimpleJIT emits code and data into memory, and provides raw pointers
|
||||||
|
/// to them.
|
||||||
|
type FinalizedFunction = *const u8;
|
||||||
|
type FinalizedData = (*mut u8, usize);
|
||||||
|
|
||||||
|
/// SimpleJIT emits code and data into memory as it processes them, so it
|
||||||
|
/// doesn't need to provide anything after the `Module` is complete.
|
||||||
|
type Product = ();
|
||||||
|
|
||||||
impl SimpleJITBackend {
|
|
||||||
/// Create a new `SimpleJITBackend`.
|
/// Create a new `SimpleJITBackend`.
|
||||||
pub fn new() -> Self {
|
fn new(builder: SimpleJITBuilder) -> Self {
|
||||||
let (flag_builder, isa_builder) = cretonne_native::builders().unwrap_or_else(|_| {
|
|
||||||
panic!("host machine is not a supported target");
|
|
||||||
});
|
|
||||||
let isa = isa_builder.finish(settings::Flags::new(&flag_builder));
|
|
||||||
Self::with_isa(isa)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Create a new `SimpleJITBackend` with an arbitrary target. This is mainly
|
|
||||||
/// useful for testing.
|
|
||||||
///
|
|
||||||
/// SimpleJIT requires a `TargetIsa` configured for non-PIC.
|
|
||||||
///
|
|
||||||
/// To create a `SimpleJITBackend` for native use, use the `new` constructor
|
|
||||||
/// instead.
|
|
||||||
pub fn with_isa(isa: Box<TargetIsa>) -> Self {
|
|
||||||
debug_assert!(!isa.flags().is_pic(), "SimpleJIT requires non-PIC code");
|
|
||||||
Self {
|
Self {
|
||||||
isa,
|
isa: builder.isa,
|
||||||
code_memory: Memory::new(),
|
code_memory: Memory::new(),
|
||||||
readonly_memory: Memory::new(),
|
readonly_memory: Memory::new(),
|
||||||
writable_memory: Memory::new(),
|
writable_memory: Memory::new(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
impl<'simple_jit_backend> Backend for SimpleJITBackend {
|
|
||||||
type CompiledFunction = SimpleJITCompiledFunction;
|
|
||||||
type CompiledData = SimpleJITCompiledData;
|
|
||||||
|
|
||||||
type FinalizedFunction = *const u8;
|
|
||||||
type FinalizedData = (*mut u8, usize);
|
|
||||||
|
|
||||||
fn isa(&self) -> &TargetIsa {
|
fn isa(&self) -> &TargetIsa {
|
||||||
&*self.isa
|
&*self.isa
|
||||||
@@ -317,6 +339,10 @@ impl<'simple_jit_backend> Backend for SimpleJITBackend {
|
|||||||
self.readonly_memory.set_readonly();
|
self.readonly_memory.set_readonly();
|
||||||
(data.storage, data.size)
|
(data.storage, data.size)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// SimpleJIT emits code and data into memory as it processes them, so it
|
||||||
|
/// doesn't need to provide anything after the `Module` is complete.
|
||||||
|
fn finish(self) -> () {}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn lookup_with_dlsym(name: &str) -> *const u8 {
|
fn lookup_with_dlsym(name: &str) -> *const u8 {
|
||||||
|
|||||||
@@ -26,4 +26,4 @@ extern crate libc;
|
|||||||
mod backend;
|
mod backend;
|
||||||
mod memory;
|
mod memory;
|
||||||
|
|
||||||
pub use backend::SimpleJITBackend;
|
pub use backend::{SimpleJITBuilder, SimpleJITBackend};
|
||||||
|
|||||||
@@ -16,17 +16,22 @@
|
|||||||
use_self,
|
use_self,
|
||||||
))]
|
))]
|
||||||
|
|
||||||
pub extern crate cretonne_codegen;
|
/// Provide these crates, renamed to reduce stutter.
|
||||||
pub extern crate cretonne_frontend;
|
pub extern crate cretonne_codegen as codegen;
|
||||||
|
pub extern crate cretonne_frontend as frontend;
|
||||||
|
|
||||||
/// A prelude providing convenient access to commonly-used cretonne features. Use
|
/// A prelude providing convenient access to commonly-used cretonne features. Use
|
||||||
/// as `use cretonne::prelude::*`.
|
/// as `use cretonne::prelude::*`.
|
||||||
pub mod prelude {
|
pub mod prelude {
|
||||||
pub use cretonne_codegen;
|
pub use codegen;
|
||||||
pub use cretonne_codegen::entity::EntityRef;
|
pub use codegen::entity::EntityRef;
|
||||||
pub use cretonne_codegen::ir::{AbiParam, InstBuilder, Value, Ebb, Signature, CallConv};
|
pub use codegen::ir::{AbiParam, InstBuilder, Value, Ebb, Signature, CallConv, Type,
|
||||||
pub use cretonne_codegen::ir::types;
|
JumpTableData, MemFlags};
|
||||||
pub use cretonne_codegen::ir::condcodes::IntCC;
|
pub use codegen::ir::types;
|
||||||
|
pub use codegen::ir::condcodes::{IntCC, FloatCC};
|
||||||
|
pub use codegen::ir::immediates::{Ieee32, Ieee64};
|
||||||
|
pub use codegen::settings::{self, Configurable};
|
||||||
|
pub use codegen::isa;
|
||||||
|
|
||||||
pub use cretonne_frontend::{FunctionBuilderContext, FunctionBuilder, Variable};
|
pub use frontend::{FunctionBuilderContext, FunctionBuilder, Variable};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user