Rename the 'cretonne' crate to 'cretonne-codegen'.
This fixes the next part of #287.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
name = "cretonne-tools"
|
||||
authors = ["The Cretonne Project Developers"]
|
||||
version = "0.4.4"
|
||||
description = "Binaries for testing the Cretonne library"
|
||||
description = "Binaries for testing the Cretonne libraries"
|
||||
license = "Apache-2.0"
|
||||
documentation = "https://cretonne.readthedocs.io/"
|
||||
repository = "https://github.com/Cretonne/cretonne"
|
||||
@@ -13,7 +13,7 @@ name = "cton-util"
|
||||
path = "src/cton-util.rs"
|
||||
|
||||
[dependencies]
|
||||
cretonne = { path = "lib/cretonne", version = "0.4.4" }
|
||||
cretonne-codegen = { path = "lib/codegen", version = "0.4.4" }
|
||||
cretonne-reader = { path = "lib/reader", version = "0.4.4" }
|
||||
cretonne-frontend = { path = "lib/frontend", version = "0.4.4" }
|
||||
cretonne-wasm = { path = "lib/wasm", version = "0.4.4" }
|
||||
@@ -30,7 +30,7 @@ term = "0.5.1"
|
||||
|
||||
# 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 crate when used as a dependency.
|
||||
# flags used to build the cretonne-* crates when used as a dependency.
|
||||
[profile.release]
|
||||
opt-level = 2
|
||||
debug-assertions = true
|
||||
|
||||
@@ -14,7 +14,7 @@ help:
|
||||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||
|
||||
autohtml: html
|
||||
$(SPHINXABUILD) -z ../lib/cretonne/meta --ignore '.*' -b html -E $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
$(SPHINXABUILD) -z ../lib/codegen/meta --ignore '.*' -b html -E $(ALLSPHINXOPTS) $(BUILDDIR)/html
|
||||
|
||||
.PHONY: help Makefile
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
# Also add the meta directory to sys.path so autodoc can find the Cretonne meta
|
||||
# language definitions.
|
||||
sys.path.insert(0, os.path.abspath('../lib/cretonne/meta'))
|
||||
sys.path.insert(0, os.path.abspath('../lib/codegen/meta'))
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ domain specific language embedded in Python. This document describes the Python
|
||||
modules that form the embedded DSL.
|
||||
|
||||
The meta language descriptions are Python modules under the
|
||||
:file:`lib/cretonne/meta` directory. The descriptions are processed in two
|
||||
:file:`lib/codegen/meta` directory. The descriptions are processed in two
|
||||
steps:
|
||||
|
||||
1. The Python modules are imported. This has the effect of building static data
|
||||
@@ -23,8 +23,8 @@ steps:
|
||||
constant tables.
|
||||
|
||||
The main driver for this source code generation process is the
|
||||
:file:`lib/cretonne/meta/build.py` script which is invoked as part of the build
|
||||
process if anything in the :file:`lib/cretonne/meta` directory has changed
|
||||
:file:`lib/codegen/meta/build.py` script which is invoked as part of the build
|
||||
process if anything in the :file:`lib/codegen/meta` directory has changed
|
||||
since the last build.
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ of code generation. Each setting is defined in the meta language so a compact
|
||||
and consistent Rust representation can be generated. Shared settings are defined
|
||||
in the :mod:`base.settings` module. Some settings are specific to a target ISA,
|
||||
and defined in a :file:`settings.py` module under the appropriate
|
||||
:file:`lib/cretonne/meta/isa/*` directory.
|
||||
:file:`lib/codegen/meta/isa/*` directory.
|
||||
|
||||
Settings can take boolean on/off values, small numbers, or explicitly enumerated
|
||||
symbolic values. Each type is represented by a sub-class of :class:`Setting`:
|
||||
@@ -433,7 +433,7 @@ architectures. Each ISA is represented by a :py:class:`cdsl.isa.TargetISA` insta
|
||||
.. autoclass:: TargetISA
|
||||
|
||||
The definitions for each supported target live in a package under
|
||||
:file:`lib/cretonne/meta/isa`.
|
||||
:file:`lib/codegen/meta/isa`.
|
||||
|
||||
.. automodule:: isa
|
||||
:members:
|
||||
|
||||
@@ -51,7 +51,7 @@ tested::
|
||||
//!
|
||||
//! # Example
|
||||
//! ```
|
||||
//! use cretonne::settings::{self, Configurable};
|
||||
//! use cretonne_codegen::settings::{self, Configurable};
|
||||
//!
|
||||
//! let mut b = settings::builder();
|
||||
//! b.set("opt_level", "fastest");
|
||||
@@ -73,9 +73,9 @@ test.
|
||||
|
||||
These tests are usually found in the :file:`tests` top-level directory where
|
||||
they have access to all the crates in the Cretonne repository. The
|
||||
:file:`lib/cretonne` and :file:`lib/reader` crates have no external
|
||||
:file:`lib/codegen` and :file:`lib/reader` crates have no external
|
||||
dependencies, which can make testing tedious. Integration tests that don't need
|
||||
to depend on other crates can be placed in :file:`lib/cretonne/tests` and
|
||||
to depend on other crates can be placed in :file:`lib/codegen/tests` and
|
||||
:file:`lib/reader/tests`.
|
||||
|
||||
File tests
|
||||
@@ -109,7 +109,7 @@ header:
|
||||
isa_spec : "isa" isa_name { `option` } "\n"
|
||||
|
||||
The options given on the ``isa`` line modify the ISA-specific settings defined in
|
||||
:file:`lib/cretonne/meta/isa/*/settings.py`.
|
||||
:file:`lib/codegen/meta/isa/*/settings.py`.
|
||||
|
||||
All types of tests allow shared Cretonne settings to be modified:
|
||||
|
||||
@@ -119,7 +119,7 @@ All types of tests allow shared Cretonne settings to be modified:
|
||||
option : flag | setting "=" value
|
||||
|
||||
The shared settings available for all target ISAs are defined in
|
||||
:file:`lib/cretonne/meta/base/settings.py`.
|
||||
:file:`lib/codegen/meta/base/settings.py`.
|
||||
|
||||
The ``set`` lines apply settings cumulatively::
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ isa x86
|
||||
;
|
||||
; The spiller panics with a
|
||||
; 'Ran out of GPR registers when inserting copy before v68 = icmp.i32 eq v66, v67',
|
||||
; lib/cretonne/src/regalloc/spilling.rs:425:28 message.
|
||||
; lib/codegen/src/regalloc/spilling.rs:425:28 message.
|
||||
;
|
||||
; The process_reg_uses() function is trying to insert a copy before the icmp instruction in ebb4
|
||||
; and runs out of registers to spill. Note that ebb7 has a lot of dead parameter values.
|
||||
|
||||
@@ -27,7 +27,7 @@ cargo update
|
||||
|
||||
echo git commit -a -m "\"Bump version to $version"\"
|
||||
echo git push
|
||||
for crate in entity cretonne frontend native reader wasm ; do
|
||||
for crate in entity codegen frontend native reader wasm ; do
|
||||
echo cargo publish --manifest-path "lib/$crate/Cargo.toml"
|
||||
done
|
||||
echo
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//! CLI tool to read Cretonne IR files and compile them into native code.
|
||||
|
||||
use cretonne::Context;
|
||||
use cretonne::print_errors::pretty_error;
|
||||
use cretonne::settings::FlagsOrIsa;
|
||||
use cretonne::{binemit, ir};
|
||||
use cretonne_codegen::Context;
|
||||
use cretonne_codegen::print_errors::pretty_error;
|
||||
use cretonne_codegen::settings::FlagsOrIsa;
|
||||
use cretonne_codegen::{binemit, ir};
|
||||
use cretonne_reader::parse_test;
|
||||
use std::path::Path;
|
||||
use std::path::PathBuf;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
extern crate cretonne;
|
||||
extern crate cretonne_codegen;
|
||||
extern crate cretonne_filetests;
|
||||
extern crate cretonne_reader;
|
||||
extern crate cretonne_wasm;
|
||||
@@ -9,7 +9,7 @@ extern crate serde_derive;
|
||||
extern crate tempdir;
|
||||
extern crate term;
|
||||
|
||||
use cretonne::{timing, VERSION};
|
||||
use cretonne_codegen::{timing, VERSION};
|
||||
use docopt::Docopt;
|
||||
use std::io::{self, Write};
|
||||
use std::process;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//! in graphviz format.
|
||||
|
||||
use CommandResult;
|
||||
use cretonne::cfg_printer::CFGPrinter;
|
||||
use cretonne_codegen::cfg_printer::CFGPrinter;
|
||||
use cretonne_reader::parse_functions;
|
||||
use utils::read_to_string;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! Utility functions.
|
||||
|
||||
use cretonne::isa;
|
||||
use cretonne::isa::TargetIsa;
|
||||
use cretonne::settings::{self, FlagsOrIsa};
|
||||
use cretonne_codegen::isa;
|
||||
use cretonne_codegen::isa::TargetIsa;
|
||||
use cretonne_codegen::settings::{self, FlagsOrIsa};
|
||||
use cretonne_reader::{parse_options, Location};
|
||||
use std::fs::File;
|
||||
use std::io::{self, Read};
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
//! Reads Wasm binary files, translates the functions' code to Cretonne IR.
|
||||
#![cfg_attr(feature = "cargo-clippy", allow(too_many_arguments, cyclomatic_complexity))]
|
||||
|
||||
use cretonne::Context;
|
||||
use cretonne::print_errors::{pretty_error, pretty_verifier_error};
|
||||
use cretonne::settings::FlagsOrIsa;
|
||||
use cretonne_codegen::Context;
|
||||
use cretonne_codegen::print_errors::{pretty_error, pretty_verifier_error};
|
||||
use cretonne_codegen::settings::FlagsOrIsa;
|
||||
use cretonne_wasm::{translate_module, DummyEnvironment, ModuleEnvironment};
|
||||
use std::error::Error;
|
||||
use std::fs::File;
|
||||
|
||||
@@ -31,13 +31,13 @@ fi
|
||||
# Check if any Python files have changed since we last checked them.
|
||||
tsfile=$topdir/target/meta-checked
|
||||
if [ -f $tsfile ]; then
|
||||
needcheck=$(find $topdir/lib/cretonne/meta -name '*.py' -newer $tsfile)
|
||||
needcheck=$(find $topdir/lib/codegen/meta -name '*.py' -newer $tsfile)
|
||||
else
|
||||
needcheck=yes
|
||||
fi
|
||||
if [ -n "$needcheck" ]; then
|
||||
banner "$(python --version 2>&1), $(python3 --version 2>&1)"
|
||||
$topdir/lib/cretonne/meta/check.sh
|
||||
$topdir/lib/codegen/meta/check.sh
|
||||
touch $tsfile || echo no target directory
|
||||
fi
|
||||
|
||||
|
||||
@@ -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`.
|
||||
@@ -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:
|
||||
//
|
||||
@@ -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
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user