Rename the 'cretonne' crate to 'cretonne-codegen'.

This fixes the next part of #287.
This commit is contained in:
Dan Gohman
2018-04-17 08:48:02 -07:00
parent 7767186dd0
commit 24fa169e1f
254 changed files with 265 additions and 264 deletions

View File

@@ -1,6 +1,6 @@
[package]
authors = ["The Cretonne Project Developers"]
name = "cretonne"
name = "cretonne-codegen"
version = "0.4.4"
description = "Low-level code generator library"
license = "Apache-2.0"
@@ -12,7 +12,7 @@ build = "build.rs"
[dependencies]
cretonne-entity = { path = "../entity", version = "0.4.4" }
# It is a goal of the cretonne crate to have minimal external dependencies.
# It is a goal of the cretonne-codegen crate to have minimal external dependencies.
# Please don't add any unless they are essential to the task of creating binary
# machine code. Integration tests that need external dependencies can be
# accomodated in `tests`.

View File

@@ -1,7 +1,7 @@
// Build script.
//
// This program is run by Cargo when building lib/cretonne. It is used to generate Rust code from
// the language definitions in the lib/cretonne/meta directory.
// This program is run by Cargo when building lib/codegen. It is used to generate Rust code from
// the language definitions in the lib/codegen/meta directory.
//
// Environment:
//

View File

@@ -1,6 +1,6 @@
# Second-level build script.
#
# This script is run from lib/cretonne/build.rs to generate Rust files.
# This script is run from lib/codegen/build.rs to generate Rust files.
from __future__ import absolute_import
import argparse

View File

@@ -1,7 +1,7 @@
"""
Generate build dependencies for Cargo.
The `build.py` script is invoked by cargo when building lib/cretonne to
The `build.py` script is invoked by cargo when building lib/codegen to
generate Rust code from the instruction descriptions. Cargo needs to know when
it is necessary to rerun the build script.

View File

@@ -2,7 +2,7 @@
Generate sources with type info.
This generates a `types.rs` file which is included in
`lib/cretonne/ir/types.rs`. The file provides constant definitions for the most
`lib/codegen/ir/types.rs`. The file provides constant definitions for the most
commonly used types, including all of the scalar types.
This ensures that Python and Rust use the same type numbering.

View File

@@ -1,6 +1,6 @@
//! Runtime support for precomputed constant hash tables.
//!
//! The `lib/cretonne/meta/constant_hash.py` Python module can generate constant hash tables using
//! The `lib/codegen/meta/constant_hash.py` Python module can generate constant hash tables using
//! open addressing and quadratic probing. The hash tables are arrays that are guaranteed to:
//!
//! - Have a power-of-two size.
@@ -56,7 +56,7 @@ pub fn probe<K: Copy + Eq, T: Table<K> + ?Sized>(
}
/// A primitive hash function for matching opcodes.
/// Must match `lib/cretonne/meta/constant_hash.py`.
/// Must match `lib/codegen/meta/constant_hash.py`.
pub fn simple_hash(s: &str) -> usize {
let mut h: u32 = 5381;
for c in s.chars() {

View File

@@ -46,8 +46,8 @@ pub trait Cursor {
/// This is intended to be used as a builder method:
///
/// ```
/// # use cretonne::ir::{Function, Ebb, SourceLoc};
/// # use cretonne::cursor::{Cursor, FuncCursor};
/// # use cretonne_codegen::ir::{Function, Ebb, SourceLoc};
/// # use cretonne_codegen::cursor::{Cursor, FuncCursor};
/// fn edit_func(func: &mut Function, srcloc: SourceLoc) {
/// let mut pos = FuncCursor::new(func).with_srcloc(srcloc);
///
@@ -76,8 +76,8 @@ pub trait Cursor {
/// This is intended to be used as a builder method:
///
/// ```
/// # use cretonne::ir::{Function, Ebb, Inst};
/// # use cretonne::cursor::{Cursor, FuncCursor};
/// # use cretonne_codegen::ir::{Function, Ebb, Inst};
/// # use cretonne_codegen::cursor::{Cursor, FuncCursor};
/// fn edit_func(func: &mut Function, inst: Inst) {
/// let mut pos = FuncCursor::new(func).at_inst(inst);
///
@@ -99,8 +99,8 @@ pub trait Cursor {
/// This is intended to be used as a builder method:
///
/// ```
/// # use cretonne::ir::{Function, Ebb, Inst};
/// # use cretonne::cursor::{Cursor, FuncCursor};
/// # use cretonne_codegen::ir::{Function, Ebb, Inst};
/// # use cretonne_codegen::cursor::{Cursor, FuncCursor};
/// fn edit_func(func: &mut Function, ebb: Ebb) {
/// let mut pos = FuncCursor::new(func).at_first_insertion_point(ebb);
///
@@ -120,8 +120,8 @@ pub trait Cursor {
/// This is intended to be used as a builder method:
///
/// ```
/// # use cretonne::ir::{Function, Ebb, Inst};
/// # use cretonne::cursor::{Cursor, FuncCursor};
/// # use cretonne_codegen::ir::{Function, Ebb, Inst};
/// # use cretonne_codegen::cursor::{Cursor, FuncCursor};
/// fn edit_func(func: &mut Function, ebb: Ebb) {
/// let mut pos = FuncCursor::new(func).at_first_inst(ebb);
///
@@ -141,8 +141,8 @@ pub trait Cursor {
/// This is intended to be used as a builder method:
///
/// ```
/// # use cretonne::ir::{Function, Ebb, Inst};
/// # use cretonne::cursor::{Cursor, FuncCursor};
/// # use cretonne_codegen::ir::{Function, Ebb, Inst};
/// # use cretonne_codegen::cursor::{Cursor, FuncCursor};
/// fn edit_func(func: &mut Function, ebb: Ebb) {
/// let mut pos = FuncCursor::new(func).at_last_inst(ebb);
///
@@ -162,8 +162,8 @@ pub trait Cursor {
/// This is intended to be used as a builder method:
///
/// ```
/// # use cretonne::ir::{Function, Ebb, Inst};
/// # use cretonne::cursor::{Cursor, FuncCursor};
/// # use cretonne_codegen::ir::{Function, Ebb, Inst};
/// # use cretonne_codegen::cursor::{Cursor, FuncCursor};
/// fn edit_func(func: &mut Function, inst: Inst) {
/// let mut pos = FuncCursor::new(func).after_inst(inst);
///
@@ -183,8 +183,8 @@ pub trait Cursor {
/// This is intended to be used as a builder method:
///
/// ```
/// # use cretonne::ir::{Function, Ebb, Inst};
/// # use cretonne::cursor::{Cursor, FuncCursor};
/// # use cretonne_codegen::ir::{Function, Ebb, Inst};
/// # use cretonne_codegen::cursor::{Cursor, FuncCursor};
/// fn edit_func(func: &mut Function, ebb: Ebb) {
/// let mut pos = FuncCursor::new(func).at_top(ebb);
///
@@ -204,8 +204,8 @@ pub trait Cursor {
/// This is intended to be used as a builder method:
///
/// ```
/// # use cretonne::ir::{Function, Ebb, Inst};
/// # use cretonne::cursor::{Cursor, FuncCursor};
/// # use cretonne_codegen::ir::{Function, Ebb, Inst};
/// # use cretonne_codegen::cursor::{Cursor, FuncCursor};
/// fn edit_func(func: &mut Function, ebb: Ebb) {
/// let mut pos = FuncCursor::new(func).at_bottom(ebb);
///
@@ -309,8 +309,8 @@ pub trait Cursor {
/// The `next_ebb()` method is intended for iterating over the EBBs in layout order:
///
/// ```
/// # use cretonne::ir::{Function, Ebb};
/// # use cretonne::cursor::{Cursor, FuncCursor};
/// # use cretonne_codegen::ir::{Function, Ebb};
/// # use cretonne_codegen::cursor::{Cursor, FuncCursor};
/// fn edit_func(func: &mut Function) {
/// let mut cursor = FuncCursor::new(func);
/// while let Some(ebb) = cursor.next_ebb() {
@@ -342,8 +342,8 @@ pub trait Cursor {
/// The `prev_ebb()` method is intended for iterating over the EBBs in backwards layout order:
///
/// ```
/// # use cretonne::ir::{Function, Ebb};
/// # use cretonne::cursor::{Cursor, FuncCursor};
/// # use cretonne_codegen::ir::{Function, Ebb};
/// # use cretonne_codegen::cursor::{Cursor, FuncCursor};
/// fn edit_func(func: &mut Function) {
/// let mut cursor = FuncCursor::new(func);
/// while let Some(ebb) = cursor.prev_ebb() {
@@ -379,8 +379,8 @@ pub trait Cursor {
/// this:
///
/// ```
/// # use cretonne::ir::{Function, Ebb};
/// # use cretonne::cursor::{Cursor, FuncCursor};
/// # use cretonne_codegen::ir::{Function, Ebb};
/// # use cretonne_codegen::cursor::{Cursor, FuncCursor};
/// fn edit_ebb(func: &mut Function, ebb: Ebb) {
/// let mut cursor = FuncCursor::new(func).at_top(ebb);
/// while let Some(inst) = cursor.next_inst() {
@@ -393,8 +393,8 @@ pub trait Cursor {
/// Iterating over all the instructions in a function looks like this:
///
/// ```
/// # use cretonne::ir::{Function, Ebb};
/// # use cretonne::cursor::{Cursor, FuncCursor};
/// # use cretonne_codegen::ir::{Function, Ebb};
/// # use cretonne_codegen::cursor::{Cursor, FuncCursor};
/// fn edit_func(func: &mut Function) {
/// let mut cursor = FuncCursor::new(func);
/// while let Some(ebb) = cursor.next_ebb() {
@@ -447,8 +447,8 @@ pub trait Cursor {
/// EBB like this:
///
/// ```
/// # use cretonne::ir::{Function, Ebb};
/// # use cretonne::cursor::{Cursor, FuncCursor};
/// # use cretonne_codegen::ir::{Function, Ebb};
/// # use cretonne_codegen::cursor::{Cursor, FuncCursor};
/// fn edit_ebb(func: &mut Function, ebb: Ebb) {
/// let mut cursor = FuncCursor::new(func).at_bottom(ebb);
/// while let Some(inst) = cursor.prev_inst() {

Some files were not shown because too many files have changed in this diff Show More