Merge branch 'master' into no_std
This commit is contained in:
@@ -1,24 +1,21 @@
|
||||
[package]
|
||||
authors = ["The Cretonne Project Developers"]
|
||||
name = "cretonne-frontend"
|
||||
version = "0.4.1"
|
||||
version = "0.5.0"
|
||||
description = "Cretonne IR builder helper"
|
||||
license = "Apache-2.0"
|
||||
documentation = "https://cretonne.readthedocs.io/"
|
||||
repository = "https://github.com/Cretonne/cretonne"
|
||||
repository = "https://github.com/cretonne/cretonne"
|
||||
readme = "README.md"
|
||||
|
||||
[lib]
|
||||
name = "cton_frontend"
|
||||
|
||||
[dependencies]
|
||||
cretonne = { path = "../cretonne", version = "0.4.1", default-features = false }
|
||||
cretonne-codegen = { path = "../codegen", version = "0.5.0", default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = ["cretonne/std"]
|
||||
core = ["cretonne/core"]
|
||||
std = ["cretonne-codegen/std"]
|
||||
core = ["cretonne-codegen/core"]
|
||||
|
||||
[badges]
|
||||
maintenance = { status = "experimental" }
|
||||
travis-ci = { repository = "Cretonne/cretonne" }
|
||||
travis-ci = { repository = "cretonne/cretonne" }
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
//! A frontend for building Cretonne IR from other languages.
|
||||
use cretonne::cursor::{Cursor, FuncCursor};
|
||||
use cretonne::entity::{EntityMap, EntityRef, EntitySet};
|
||||
use cretonne::ir;
|
||||
use cretonne::ir::function::DisplayFunction;
|
||||
use cretonne::ir::{DataFlowGraph, Ebb, ExtFuncData, FuncRef, Function, GlobalVar, GlobalVarData,
|
||||
Heap, HeapData, Inst, InstBuilderBase, InstructionData, JumpTable,
|
||||
JumpTableData, SigRef, Signature, StackSlot, StackSlotData, Type, Value};
|
||||
use cretonne::isa::TargetIsa;
|
||||
use cretonne::packed_option::PackedOption;
|
||||
use cretonne_codegen::cursor::{Cursor, FuncCursor};
|
||||
use cretonne_codegen::entity::{EntityMap, EntityRef, EntitySet};
|
||||
use cretonne_codegen::ir;
|
||||
use cretonne_codegen::ir::function::DisplayFunction;
|
||||
use cretonne_codegen::ir::{DataFlowGraph, Ebb, ExtFuncData, FuncRef, Function, GlobalVar,
|
||||
GlobalVarData, Heap, HeapData, Inst, InstBuilderBase, InstructionData,
|
||||
JumpTable, JumpTableData, SigRef, Signature, StackSlot, StackSlotData,
|
||||
Type, Value};
|
||||
use cretonne_codegen::isa::TargetIsa;
|
||||
use cretonne_codegen::packed_option::PackedOption;
|
||||
use ssa::{Block, SSABuilder, SideEffects};
|
||||
|
||||
/// Structure used for translating a series of functions into Cretonne IR.
|
||||
@@ -101,7 +102,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Implementation of the [`InstBuilder`](../cretonne/ir/builder/trait.InstBuilder.html) that has
|
||||
/// Implementation of the [`InstBuilder`](../codegen/ir/builder/trait.InstBuilder.html) that has
|
||||
/// one convenience method per Cretonne IR instruction.
|
||||
pub struct FuncInstBuilder<'short, 'long: 'short, Variable: 'long>
|
||||
where
|
||||
@@ -374,7 +375,7 @@ where
|
||||
self.func.create_heap(data)
|
||||
}
|
||||
|
||||
/// Returns an object with the [`InstBuilder`](../cretonne/ir/builder/trait.InstBuilder.html)
|
||||
/// Returns an object with the [`InstBuilder`](../codegen/ir/builder/trait.InstBuilder.html)
|
||||
/// trait that allows to conveniently append an instruction to the current `Ebb` being built.
|
||||
pub fn ins<'short>(&'short mut self) -> FuncInstBuilder<'short, 'a, Variable> {
|
||||
let ebb = self.position.ebb.unwrap();
|
||||
@@ -593,11 +594,11 @@ where
|
||||
mod tests {
|
||||
|
||||
use Variable;
|
||||
use cretonne::entity::EntityRef;
|
||||
use cretonne::ir::types::*;
|
||||
use cretonne::ir::{AbiParam, CallConv, ExternalName, Function, InstBuilder, Signature};
|
||||
use cretonne::settings;
|
||||
use cretonne::verifier::verify_function;
|
||||
use cretonne_codegen::entity::EntityRef;
|
||||
use cretonne_codegen::ir::types::*;
|
||||
use cretonne_codegen::ir::{AbiParam, CallConv, ExternalName, Function, InstBuilder, Signature};
|
||||
use cretonne_codegen::settings;
|
||||
use cretonne_codegen::verifier::verify_function;
|
||||
use frontend::{FunctionBuilder, FunctionBuilderContext};
|
||||
|
||||
fn sample_function(lazy_seal: bool) {
|
||||
|
||||
@@ -32,15 +32,15 @@
|
||||
//! Here is how you build the corresponding Cretonne IR function using `FunctionBuilderContext`:
|
||||
//!
|
||||
//! ```rust
|
||||
//! extern crate cretonne;
|
||||
//! extern crate cton_frontend;
|
||||
//! extern crate cretonne_codegen;
|
||||
//! extern crate cretonne_frontend;
|
||||
//!
|
||||
//! use cretonne::entity::EntityRef;
|
||||
//! use cretonne::ir::{ExternalName, CallConv, Function, Signature, AbiParam, InstBuilder};
|
||||
//! use cretonne::ir::types::*;
|
||||
//! use cretonne::settings;
|
||||
//! use cton_frontend::{FunctionBuilderContext, FunctionBuilder, Variable};
|
||||
//! use cretonne::verifier::verify_function;
|
||||
//! use cretonne_codegen::entity::EntityRef;
|
||||
//! use cretonne_codegen::ir::{ExternalName, CallConv, Function, Signature, AbiParam, InstBuilder};
|
||||
//! use cretonne_codegen::ir::types::*;
|
||||
//! use cretonne_codegen::settings;
|
||||
//! use cretonne_frontend::{FunctionBuilderContext, FunctionBuilder, Variable};
|
||||
//! use cretonne_codegen::verifier::verify_function;
|
||||
//!
|
||||
//! fn main() {
|
||||
//! let mut sig = Signature::new(CallConv::SystemV);
|
||||
@@ -129,11 +129,10 @@
|
||||
|
||||
#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)]
|
||||
#![cfg_attr(feature = "cargo-clippy", allow(new_without_default, redundant_field_names))]
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
#![cfg_attr(not(feature = "std"), feature(alloc))]
|
||||
|
||||
extern crate cretonne;
|
||||
extern crate cretonne_codegen;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
extern crate alloc;
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
//! In: Jhala R., De Bosschere K. (eds) Compiler Construction. CC 2013.
|
||||
//! Lecture Notes in Computer Science, vol 7791. Springer, Berlin, Heidelberg
|
||||
|
||||
use cretonne::cursor::{Cursor, FuncCursor};
|
||||
use cretonne::entity::{EntityMap, EntityRef, PrimaryMap};
|
||||
use cretonne::ir::immediates::{Ieee32, Ieee64};
|
||||
use cretonne::ir::instructions::BranchInfo;
|
||||
use cretonne::ir::types::{F32, F64};
|
||||
use cretonne::ir::{Ebb, Function, Inst, InstBuilder, Type, Value};
|
||||
use cretonne::packed_option::PackedOption;
|
||||
use cretonne::packed_option::ReservedValue;
|
||||
use cretonne_codegen::cursor::{Cursor, FuncCursor};
|
||||
use cretonne_codegen::entity::{EntityMap, EntityRef, PrimaryMap};
|
||||
use cretonne_codegen::ir::immediates::{Ieee32, Ieee64};
|
||||
use cretonne_codegen::ir::instructions::BranchInfo;
|
||||
use cretonne_codegen::ir::types::{F32, F64};
|
||||
use cretonne_codegen::ir::{Ebb, Function, Inst, InstBuilder, Type, Value};
|
||||
use cretonne_codegen::packed_option::PackedOption;
|
||||
use cretonne_codegen::packed_option::ReservedValue;
|
||||
use std::mem;
|
||||
use std::u32;
|
||||
use std::vec::Vec;
|
||||
@@ -714,13 +714,13 @@ where
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use Variable;
|
||||
use cretonne::cursor::{Cursor, FuncCursor};
|
||||
use cretonne::entity::EntityRef;
|
||||
use cretonne::ir::instructions::BranchInfo;
|
||||
use cretonne::ir::types::*;
|
||||
use cretonne::ir::{Function, Inst, InstBuilder, JumpTableData, Opcode};
|
||||
use cretonne::settings;
|
||||
use cretonne::verify_function;
|
||||
use cretonne_codegen::cursor::{Cursor, FuncCursor};
|
||||
use cretonne_codegen::entity::EntityRef;
|
||||
use cretonne_codegen::ir::instructions::BranchInfo;
|
||||
use cretonne_codegen::ir::types::*;
|
||||
use cretonne_codegen::ir::{Function, Inst, InstBuilder, JumpTableData, Opcode};
|
||||
use cretonne_codegen::settings;
|
||||
use cretonne_codegen::verify_function;
|
||||
use ssa::SSABuilder;
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
//! their own index types to use them directly. Frontends which don't
|
||||
//! can use the `Variable` defined here.
|
||||
|
||||
use cretonne::entity::EntityRef;
|
||||
use cretonne_codegen::entity::EntityRef;
|
||||
use std::u32;
|
||||
|
||||
///! An opaque reference to a variable.
|
||||
|
||||
Reference in New Issue
Block a user