Add an "umbrella" crate, which seeks to provide a convenient interface.

This currently pulls in cretonne-codegen and cretonne-frontend and
provides a simple prelude interface.

This fixes #287.
This commit is contained in:
Dan Gohman
2018-04-17 09:13:33 -07:00
parent f43b6aca1a
commit 85662fbca9
5 changed files with 48 additions and 1 deletions

18
lib/umbrella/Cargo.toml Normal file
View File

@@ -0,0 +1,18 @@
[package]
authors = ["The Cretonne Project Developers"]
name = "cretonne"
version = "0.4.4"
description = "Umbrella for commonly-used cretonne crates"
license = "Apache-2.0"
documentation = "https://cretonne.readthedocs.io/"
repository = "https://github.com/cretonne/cretonne"
readme = "README.md"
keywords = ["compile", "compiler", "jit"]
[dependencies]
cretonne-codegen = { path = "../codegen", version = "0.4.4" }
cretonne-frontend = { path = "../frontend", version = "0.4.4" }
[badges]
maintenance = { status = "experimental" }
travis-ci = { repository = "cretonne/cretonne" }

3
lib/umbrella/README.md Normal file
View File

@@ -0,0 +1,3 @@
This is an umbrella crate which contains no code of its own, but pulls in
other cretonne library crates to provide a convenient one-line dependency
for common use cases.

19
lib/umbrella/src/lib.rs Normal file
View File

@@ -0,0 +1,19 @@
//! Cretonne umbrella crate, providing a convenient one-line dependency.
#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)]
#![cfg_attr(feature = "clippy", plugin(clippy(conf_file = "../../clippy.toml")))]
pub extern crate cretonne_codegen;
pub extern crate cretonne_frontend;
/// A prelude providing convenient access to commonly-used cretonne features. Use
/// as `use cretonne::prelude::*`.
pub mod prelude {
pub use cretonne_codegen;
pub use cretonne_codegen::entity::EntityRef;
pub use cretonne_codegen::ir::{AbiParam, InstBuilder, Value, Ebb, Signature, CallConv};
pub use cretonne_codegen::ir::types;
pub use cretonne_codegen::ir::condcodes::IntCC;
pub use cretonne_frontend::{FunctionBuilderContext, FunctionBuilder, Variable};
}