diff --git a/cranelift/Cargo.toml b/cranelift/Cargo.toml index c5ab163829..62b485ae50 100644 --- a/cranelift/Cargo.toml +++ b/cranelift/Cargo.toml @@ -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 diff --git a/cranelift/docs/Makefile b/cranelift/docs/Makefile index 335779f1f3..6ac763bdd3 100644 --- a/cranelift/docs/Makefile +++ b/cranelift/docs/Makefile @@ -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 diff --git a/cranelift/docs/conf.py b/cranelift/docs/conf.py index 20cfd32f91..b2c1f14f97 100644 --- a/cranelift/docs/conf.py +++ b/cranelift/docs/conf.py @@ -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 ------------------------------------------------ diff --git a/cranelift/docs/metaref.rst b/cranelift/docs/metaref.rst index d0b78d3a07..134628a8b1 100644 --- a/cranelift/docs/metaref.rst +++ b/cranelift/docs/metaref.rst @@ -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: diff --git a/cranelift/docs/testing.rst b/cranelift/docs/testing.rst index db7efb1da1..b2ea827075 100644 --- a/cranelift/docs/testing.rst +++ b/cranelift/docs/testing.rst @@ -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:: diff --git a/cranelift/filetests/regalloc/spill-noregs.cton b/cranelift/filetests/regalloc/spill-noregs.cton index 65f1da84c8..ffb9f041c1 100644 --- a/cranelift/filetests/regalloc/spill-noregs.cton +++ b/cranelift/filetests/regalloc/spill-noregs.cton @@ -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. diff --git a/cranelift/publish-all.sh b/cranelift/publish-all.sh index c98d0da07a..3b17f7cf1a 100755 --- a/cranelift/publish-all.sh +++ b/cranelift/publish-all.sh @@ -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 diff --git a/cranelift/src/compile.rs b/cranelift/src/compile.rs index 722f5b83c7..ae8cd1e30c 100644 --- a/cranelift/src/compile.rs +++ b/cranelift/src/compile.rs @@ -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; diff --git a/cranelift/src/cton-util.rs b/cranelift/src/cton-util.rs index 7ab78d649a..20743d923b 100644 --- a/cranelift/src/cton-util.rs +++ b/cranelift/src/cton-util.rs @@ -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; diff --git a/cranelift/src/print_cfg.rs b/cranelift/src/print_cfg.rs index 8dbd4324fc..f078c7ee54 100644 --- a/cranelift/src/print_cfg.rs +++ b/cranelift/src/print_cfg.rs @@ -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; diff --git a/cranelift/src/utils.rs b/cranelift/src/utils.rs index fe43be14ab..4d54cf118a 100644 --- a/cranelift/src/utils.rs +++ b/cranelift/src/utils.rs @@ -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}; diff --git a/cranelift/src/wasm.rs b/cranelift/src/wasm.rs index 1cbe2c754b..5ef8e21f2e 100644 --- a/cranelift/src/wasm.rs +++ b/cranelift/src/wasm.rs @@ -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; diff --git a/cranelift/test-all.sh b/cranelift/test-all.sh index 572bf5de7b..ba3faf70b0 100755 --- a/cranelift/test-all.sh +++ b/cranelift/test-all.sh @@ -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 diff --git a/lib/cretonne/Cargo.toml b/lib/codegen/Cargo.toml similarity index 86% rename from lib/cretonne/Cargo.toml rename to lib/codegen/Cargo.toml index d252fec291..6a5027f0f7 100644 --- a/lib/cretonne/Cargo.toml +++ b/lib/codegen/Cargo.toml @@ -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`. diff --git a/lib/cretonne/README.md b/lib/codegen/README.md similarity index 100% rename from lib/cretonne/README.md rename to lib/codegen/README.md diff --git a/lib/cretonne/build.rs b/lib/codegen/build.rs similarity index 96% rename from lib/cretonne/build.rs rename to lib/codegen/build.rs index 8031a71c5a..69100ef00f 100644 --- a/lib/cretonne/build.rs +++ b/lib/codegen/build.rs @@ -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: // diff --git a/lib/cretonne/meta/base/__init__.py b/lib/codegen/meta/base/__init__.py similarity index 100% rename from lib/cretonne/meta/base/__init__.py rename to lib/codegen/meta/base/__init__.py diff --git a/lib/cretonne/meta/base/entities.py b/lib/codegen/meta/base/entities.py similarity index 100% rename from lib/cretonne/meta/base/entities.py rename to lib/codegen/meta/base/entities.py diff --git a/lib/cretonne/meta/base/formats.py b/lib/codegen/meta/base/formats.py similarity index 100% rename from lib/cretonne/meta/base/formats.py rename to lib/codegen/meta/base/formats.py diff --git a/lib/cretonne/meta/base/immediates.py b/lib/codegen/meta/base/immediates.py similarity index 100% rename from lib/cretonne/meta/base/immediates.py rename to lib/codegen/meta/base/immediates.py diff --git a/lib/cretonne/meta/base/instructions.py b/lib/codegen/meta/base/instructions.py similarity index 100% rename from lib/cretonne/meta/base/instructions.py rename to lib/codegen/meta/base/instructions.py diff --git a/lib/cretonne/meta/base/legalize.py b/lib/codegen/meta/base/legalize.py similarity index 100% rename from lib/cretonne/meta/base/legalize.py rename to lib/codegen/meta/base/legalize.py diff --git a/lib/cretonne/meta/base/predicates.py b/lib/codegen/meta/base/predicates.py similarity index 100% rename from lib/cretonne/meta/base/predicates.py rename to lib/codegen/meta/base/predicates.py diff --git a/lib/cretonne/meta/base/semantics.py b/lib/codegen/meta/base/semantics.py similarity index 100% rename from lib/cretonne/meta/base/semantics.py rename to lib/codegen/meta/base/semantics.py diff --git a/lib/cretonne/meta/base/settings.py b/lib/codegen/meta/base/settings.py similarity index 100% rename from lib/cretonne/meta/base/settings.py rename to lib/codegen/meta/base/settings.py diff --git a/lib/cretonne/meta/base/types.py b/lib/codegen/meta/base/types.py similarity index 100% rename from lib/cretonne/meta/base/types.py rename to lib/codegen/meta/base/types.py diff --git a/lib/cretonne/meta/build.py b/lib/codegen/meta/build.py similarity index 92% rename from lib/cretonne/meta/build.py rename to lib/codegen/meta/build.py index 8c83300604..d7ad4cdba2 100644 --- a/lib/cretonne/meta/build.py +++ b/lib/codegen/meta/build.py @@ -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 diff --git a/lib/cretonne/meta/cdsl/__init__.py b/lib/codegen/meta/cdsl/__init__.py similarity index 100% rename from lib/cretonne/meta/cdsl/__init__.py rename to lib/codegen/meta/cdsl/__init__.py diff --git a/lib/cretonne/meta/cdsl/ast.py b/lib/codegen/meta/cdsl/ast.py similarity index 100% rename from lib/cretonne/meta/cdsl/ast.py rename to lib/codegen/meta/cdsl/ast.py diff --git a/lib/cretonne/meta/cdsl/formats.py b/lib/codegen/meta/cdsl/formats.py similarity index 100% rename from lib/cretonne/meta/cdsl/formats.py rename to lib/codegen/meta/cdsl/formats.py diff --git a/lib/cretonne/meta/cdsl/instructions.py b/lib/codegen/meta/cdsl/instructions.py similarity index 100% rename from lib/cretonne/meta/cdsl/instructions.py rename to lib/codegen/meta/cdsl/instructions.py diff --git a/lib/cretonne/meta/cdsl/isa.py b/lib/codegen/meta/cdsl/isa.py similarity index 100% rename from lib/cretonne/meta/cdsl/isa.py rename to lib/codegen/meta/cdsl/isa.py diff --git a/lib/cretonne/meta/cdsl/operands.py b/lib/codegen/meta/cdsl/operands.py similarity index 100% rename from lib/cretonne/meta/cdsl/operands.py rename to lib/codegen/meta/cdsl/operands.py diff --git a/lib/cretonne/meta/cdsl/predicates.py b/lib/codegen/meta/cdsl/predicates.py similarity index 100% rename from lib/cretonne/meta/cdsl/predicates.py rename to lib/codegen/meta/cdsl/predicates.py diff --git a/lib/cretonne/meta/cdsl/registers.py b/lib/codegen/meta/cdsl/registers.py similarity index 100% rename from lib/cretonne/meta/cdsl/registers.py rename to lib/codegen/meta/cdsl/registers.py diff --git a/lib/cretonne/meta/cdsl/settings.py b/lib/codegen/meta/cdsl/settings.py similarity index 100% rename from lib/cretonne/meta/cdsl/settings.py rename to lib/codegen/meta/cdsl/settings.py diff --git a/lib/cretonne/meta/cdsl/test_ast.py b/lib/codegen/meta/cdsl/test_ast.py similarity index 100% rename from lib/cretonne/meta/cdsl/test_ast.py rename to lib/codegen/meta/cdsl/test_ast.py diff --git a/lib/cretonne/meta/cdsl/test_package.py b/lib/codegen/meta/cdsl/test_package.py similarity index 100% rename from lib/cretonne/meta/cdsl/test_package.py rename to lib/codegen/meta/cdsl/test_package.py diff --git a/lib/cretonne/meta/cdsl/test_ti.py b/lib/codegen/meta/cdsl/test_ti.py similarity index 100% rename from lib/cretonne/meta/cdsl/test_ti.py rename to lib/codegen/meta/cdsl/test_ti.py diff --git a/lib/cretonne/meta/cdsl/test_typevar.py b/lib/codegen/meta/cdsl/test_typevar.py similarity index 100% rename from lib/cretonne/meta/cdsl/test_typevar.py rename to lib/codegen/meta/cdsl/test_typevar.py diff --git a/lib/cretonne/meta/cdsl/test_xform.py b/lib/codegen/meta/cdsl/test_xform.py similarity index 100% rename from lib/cretonne/meta/cdsl/test_xform.py rename to lib/codegen/meta/cdsl/test_xform.py diff --git a/lib/cretonne/meta/cdsl/ti.py b/lib/codegen/meta/cdsl/ti.py similarity index 100% rename from lib/cretonne/meta/cdsl/ti.py rename to lib/codegen/meta/cdsl/ti.py diff --git a/lib/cretonne/meta/cdsl/types.py b/lib/codegen/meta/cdsl/types.py similarity index 100% rename from lib/cretonne/meta/cdsl/types.py rename to lib/codegen/meta/cdsl/types.py diff --git a/lib/cretonne/meta/cdsl/typevar.py b/lib/codegen/meta/cdsl/typevar.py similarity index 100% rename from lib/cretonne/meta/cdsl/typevar.py rename to lib/codegen/meta/cdsl/typevar.py diff --git a/lib/cretonne/meta/cdsl/xform.py b/lib/codegen/meta/cdsl/xform.py similarity index 100% rename from lib/cretonne/meta/cdsl/xform.py rename to lib/codegen/meta/cdsl/xform.py diff --git a/lib/cretonne/meta/check.sh b/lib/codegen/meta/check.sh similarity index 100% rename from lib/cretonne/meta/check.sh rename to lib/codegen/meta/check.sh diff --git a/lib/cretonne/meta/constant_hash.py b/lib/codegen/meta/constant_hash.py similarity index 100% rename from lib/cretonne/meta/constant_hash.py rename to lib/codegen/meta/constant_hash.py diff --git a/lib/cretonne/meta/gen_binemit.py b/lib/codegen/meta/gen_binemit.py similarity index 100% rename from lib/cretonne/meta/gen_binemit.py rename to lib/codegen/meta/gen_binemit.py diff --git a/lib/cretonne/meta/gen_build_deps.py b/lib/codegen/meta/gen_build_deps.py similarity index 94% rename from lib/cretonne/meta/gen_build_deps.py rename to lib/codegen/meta/gen_build_deps.py index 5e1419284c..03d9ee72d0 100644 --- a/lib/cretonne/meta/gen_build_deps.py +++ b/lib/codegen/meta/gen_build_deps.py @@ -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. diff --git a/lib/cretonne/meta/gen_encoding.py b/lib/codegen/meta/gen_encoding.py similarity index 100% rename from lib/cretonne/meta/gen_encoding.py rename to lib/codegen/meta/gen_encoding.py diff --git a/lib/cretonne/meta/gen_instr.py b/lib/codegen/meta/gen_instr.py similarity index 100% rename from lib/cretonne/meta/gen_instr.py rename to lib/codegen/meta/gen_instr.py diff --git a/lib/cretonne/meta/gen_legalizer.py b/lib/codegen/meta/gen_legalizer.py similarity index 100% rename from lib/cretonne/meta/gen_legalizer.py rename to lib/codegen/meta/gen_legalizer.py diff --git a/lib/cretonne/meta/gen_registers.py b/lib/codegen/meta/gen_registers.py similarity index 100% rename from lib/cretonne/meta/gen_registers.py rename to lib/codegen/meta/gen_registers.py diff --git a/lib/cretonne/meta/gen_settings.py b/lib/codegen/meta/gen_settings.py similarity index 100% rename from lib/cretonne/meta/gen_settings.py rename to lib/codegen/meta/gen_settings.py diff --git a/lib/cretonne/meta/gen_types.py b/lib/codegen/meta/gen_types.py similarity index 95% rename from lib/cretonne/meta/gen_types.py rename to lib/codegen/meta/gen_types.py index bc912e78f7..4199efa51f 100644 --- a/lib/cretonne/meta/gen_types.py +++ b/lib/codegen/meta/gen_types.py @@ -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. diff --git a/lib/cretonne/meta/isa/__init__.py b/lib/codegen/meta/isa/__init__.py similarity index 100% rename from lib/cretonne/meta/isa/__init__.py rename to lib/codegen/meta/isa/__init__.py diff --git a/lib/cretonne/meta/isa/arm32/__init__.py b/lib/codegen/meta/isa/arm32/__init__.py similarity index 100% rename from lib/cretonne/meta/isa/arm32/__init__.py rename to lib/codegen/meta/isa/arm32/__init__.py diff --git a/lib/cretonne/meta/isa/arm32/defs.py b/lib/codegen/meta/isa/arm32/defs.py similarity index 100% rename from lib/cretonne/meta/isa/arm32/defs.py rename to lib/codegen/meta/isa/arm32/defs.py diff --git a/lib/cretonne/meta/isa/arm32/registers.py b/lib/codegen/meta/isa/arm32/registers.py similarity index 100% rename from lib/cretonne/meta/isa/arm32/registers.py rename to lib/codegen/meta/isa/arm32/registers.py diff --git a/lib/cretonne/meta/isa/arm32/settings.py b/lib/codegen/meta/isa/arm32/settings.py similarity index 100% rename from lib/cretonne/meta/isa/arm32/settings.py rename to lib/codegen/meta/isa/arm32/settings.py diff --git a/lib/cretonne/meta/isa/arm64/__init__.py b/lib/codegen/meta/isa/arm64/__init__.py similarity index 100% rename from lib/cretonne/meta/isa/arm64/__init__.py rename to lib/codegen/meta/isa/arm64/__init__.py diff --git a/lib/cretonne/meta/isa/arm64/defs.py b/lib/codegen/meta/isa/arm64/defs.py similarity index 100% rename from lib/cretonne/meta/isa/arm64/defs.py rename to lib/codegen/meta/isa/arm64/defs.py diff --git a/lib/cretonne/meta/isa/arm64/registers.py b/lib/codegen/meta/isa/arm64/registers.py similarity index 100% rename from lib/cretonne/meta/isa/arm64/registers.py rename to lib/codegen/meta/isa/arm64/registers.py diff --git a/lib/cretonne/meta/isa/arm64/settings.py b/lib/codegen/meta/isa/arm64/settings.py similarity index 100% rename from lib/cretonne/meta/isa/arm64/settings.py rename to lib/codegen/meta/isa/arm64/settings.py diff --git a/lib/cretonne/meta/isa/riscv/__init__.py b/lib/codegen/meta/isa/riscv/__init__.py similarity index 100% rename from lib/cretonne/meta/isa/riscv/__init__.py rename to lib/codegen/meta/isa/riscv/__init__.py diff --git a/lib/cretonne/meta/isa/riscv/defs.py b/lib/codegen/meta/isa/riscv/defs.py similarity index 100% rename from lib/cretonne/meta/isa/riscv/defs.py rename to lib/codegen/meta/isa/riscv/defs.py diff --git a/lib/cretonne/meta/isa/riscv/encodings.py b/lib/codegen/meta/isa/riscv/encodings.py similarity index 100% rename from lib/cretonne/meta/isa/riscv/encodings.py rename to lib/codegen/meta/isa/riscv/encodings.py diff --git a/lib/cretonne/meta/isa/riscv/recipes.py b/lib/codegen/meta/isa/riscv/recipes.py similarity index 100% rename from lib/cretonne/meta/isa/riscv/recipes.py rename to lib/codegen/meta/isa/riscv/recipes.py diff --git a/lib/cretonne/meta/isa/riscv/registers.py b/lib/codegen/meta/isa/riscv/registers.py similarity index 100% rename from lib/cretonne/meta/isa/riscv/registers.py rename to lib/codegen/meta/isa/riscv/registers.py diff --git a/lib/cretonne/meta/isa/riscv/settings.py b/lib/codegen/meta/isa/riscv/settings.py similarity index 100% rename from lib/cretonne/meta/isa/riscv/settings.py rename to lib/codegen/meta/isa/riscv/settings.py diff --git a/lib/cretonne/meta/isa/x86/__init__.py b/lib/codegen/meta/isa/x86/__init__.py similarity index 100% rename from lib/cretonne/meta/isa/x86/__init__.py rename to lib/codegen/meta/isa/x86/__init__.py diff --git a/lib/cretonne/meta/isa/x86/defs.py b/lib/codegen/meta/isa/x86/defs.py similarity index 100% rename from lib/cretonne/meta/isa/x86/defs.py rename to lib/codegen/meta/isa/x86/defs.py diff --git a/lib/cretonne/meta/isa/x86/encodings.py b/lib/codegen/meta/isa/x86/encodings.py similarity index 100% rename from lib/cretonne/meta/isa/x86/encodings.py rename to lib/codegen/meta/isa/x86/encodings.py diff --git a/lib/cretonne/meta/isa/x86/instructions.py b/lib/codegen/meta/isa/x86/instructions.py similarity index 100% rename from lib/cretonne/meta/isa/x86/instructions.py rename to lib/codegen/meta/isa/x86/instructions.py diff --git a/lib/cretonne/meta/isa/x86/legalize.py b/lib/codegen/meta/isa/x86/legalize.py similarity index 100% rename from lib/cretonne/meta/isa/x86/legalize.py rename to lib/codegen/meta/isa/x86/legalize.py diff --git a/lib/cretonne/meta/isa/x86/recipes.py b/lib/codegen/meta/isa/x86/recipes.py similarity index 100% rename from lib/cretonne/meta/isa/x86/recipes.py rename to lib/codegen/meta/isa/x86/recipes.py diff --git a/lib/cretonne/meta/isa/x86/registers.py b/lib/codegen/meta/isa/x86/registers.py similarity index 100% rename from lib/cretonne/meta/isa/x86/registers.py rename to lib/codegen/meta/isa/x86/registers.py diff --git a/lib/cretonne/meta/isa/x86/settings.py b/lib/codegen/meta/isa/x86/settings.py similarity index 100% rename from lib/cretonne/meta/isa/x86/settings.py rename to lib/codegen/meta/isa/x86/settings.py diff --git a/lib/cretonne/meta/mypy.ini b/lib/codegen/meta/mypy.ini similarity index 100% rename from lib/cretonne/meta/mypy.ini rename to lib/codegen/meta/mypy.ini diff --git a/lib/cretonne/meta/semantics/__init__.py b/lib/codegen/meta/semantics/__init__.py similarity index 100% rename from lib/cretonne/meta/semantics/__init__.py rename to lib/codegen/meta/semantics/__init__.py diff --git a/lib/cretonne/meta/semantics/elaborate.py b/lib/codegen/meta/semantics/elaborate.py similarity index 100% rename from lib/cretonne/meta/semantics/elaborate.py rename to lib/codegen/meta/semantics/elaborate.py diff --git a/lib/cretonne/meta/semantics/macros.py b/lib/codegen/meta/semantics/macros.py similarity index 100% rename from lib/cretonne/meta/semantics/macros.py rename to lib/codegen/meta/semantics/macros.py diff --git a/lib/cretonne/meta/semantics/primitives.py b/lib/codegen/meta/semantics/primitives.py similarity index 100% rename from lib/cretonne/meta/semantics/primitives.py rename to lib/codegen/meta/semantics/primitives.py diff --git a/lib/cretonne/meta/semantics/smtlib.py b/lib/codegen/meta/semantics/smtlib.py similarity index 100% rename from lib/cretonne/meta/semantics/smtlib.py rename to lib/codegen/meta/semantics/smtlib.py diff --git a/lib/cretonne/meta/semantics/test_elaborate.py b/lib/codegen/meta/semantics/test_elaborate.py similarity index 100% rename from lib/cretonne/meta/semantics/test_elaborate.py rename to lib/codegen/meta/semantics/test_elaborate.py diff --git a/lib/cretonne/meta/srcgen.py b/lib/codegen/meta/srcgen.py similarity index 100% rename from lib/cretonne/meta/srcgen.py rename to lib/codegen/meta/srcgen.py diff --git a/lib/cretonne/meta/stubs/z3/__init__.pyi b/lib/codegen/meta/stubs/z3/__init__.pyi similarity index 100% rename from lib/cretonne/meta/stubs/z3/__init__.pyi rename to lib/codegen/meta/stubs/z3/__init__.pyi diff --git a/lib/cretonne/meta/stubs/z3/z3core.pyi b/lib/codegen/meta/stubs/z3/z3core.pyi similarity index 100% rename from lib/cretonne/meta/stubs/z3/z3core.pyi rename to lib/codegen/meta/stubs/z3/z3core.pyi diff --git a/lib/cretonne/meta/stubs/z3/z3types.pyi b/lib/codegen/meta/stubs/z3/z3types.pyi similarity index 100% rename from lib/cretonne/meta/stubs/z3/z3types.pyi rename to lib/codegen/meta/stubs/z3/z3types.pyi diff --git a/lib/cretonne/meta/test_constant_hash.py b/lib/codegen/meta/test_constant_hash.py similarity index 100% rename from lib/cretonne/meta/test_constant_hash.py rename to lib/codegen/meta/test_constant_hash.py diff --git a/lib/cretonne/meta/test_gen_legalizer.py b/lib/codegen/meta/test_gen_legalizer.py similarity index 100% rename from lib/cretonne/meta/test_gen_legalizer.py rename to lib/codegen/meta/test_gen_legalizer.py diff --git a/lib/cretonne/meta/test_srcgen.py b/lib/codegen/meta/test_srcgen.py similarity index 100% rename from lib/cretonne/meta/test_srcgen.py rename to lib/codegen/meta/test_srcgen.py diff --git a/lib/cretonne/meta/unique_table.py b/lib/codegen/meta/unique_table.py similarity index 100% rename from lib/cretonne/meta/unique_table.py rename to lib/codegen/meta/unique_table.py diff --git a/lib/cretonne/src/abi.rs b/lib/codegen/src/abi.rs similarity index 100% rename from lib/cretonne/src/abi.rs rename to lib/codegen/src/abi.rs diff --git a/lib/cretonne/src/bforest/map.rs b/lib/codegen/src/bforest/map.rs similarity index 100% rename from lib/cretonne/src/bforest/map.rs rename to lib/codegen/src/bforest/map.rs diff --git a/lib/cretonne/src/bforest/mod.rs b/lib/codegen/src/bforest/mod.rs similarity index 100% rename from lib/cretonne/src/bforest/mod.rs rename to lib/codegen/src/bforest/mod.rs diff --git a/lib/cretonne/src/bforest/node.rs b/lib/codegen/src/bforest/node.rs similarity index 100% rename from lib/cretonne/src/bforest/node.rs rename to lib/codegen/src/bforest/node.rs diff --git a/lib/cretonne/src/bforest/path.rs b/lib/codegen/src/bforest/path.rs similarity index 100% rename from lib/cretonne/src/bforest/path.rs rename to lib/codegen/src/bforest/path.rs diff --git a/lib/cretonne/src/bforest/pool.rs b/lib/codegen/src/bforest/pool.rs similarity index 100% rename from lib/cretonne/src/bforest/pool.rs rename to lib/codegen/src/bforest/pool.rs diff --git a/lib/cretonne/src/bforest/set.rs b/lib/codegen/src/bforest/set.rs similarity index 100% rename from lib/cretonne/src/bforest/set.rs rename to lib/codegen/src/bforest/set.rs diff --git a/lib/cretonne/src/binemit/memorysink.rs b/lib/codegen/src/binemit/memorysink.rs similarity index 100% rename from lib/cretonne/src/binemit/memorysink.rs rename to lib/codegen/src/binemit/memorysink.rs diff --git a/lib/cretonne/src/binemit/mod.rs b/lib/codegen/src/binemit/mod.rs similarity index 100% rename from lib/cretonne/src/binemit/mod.rs rename to lib/codegen/src/binemit/mod.rs diff --git a/lib/cretonne/src/binemit/relaxation.rs b/lib/codegen/src/binemit/relaxation.rs similarity index 100% rename from lib/cretonne/src/binemit/relaxation.rs rename to lib/codegen/src/binemit/relaxation.rs diff --git a/lib/cretonne/src/bitset.rs b/lib/codegen/src/bitset.rs similarity index 100% rename from lib/cretonne/src/bitset.rs rename to lib/codegen/src/bitset.rs diff --git a/lib/cretonne/src/cfg_printer.rs b/lib/codegen/src/cfg_printer.rs similarity index 100% rename from lib/cretonne/src/cfg_printer.rs rename to lib/codegen/src/cfg_printer.rs diff --git a/lib/cretonne/src/constant_hash.rs b/lib/codegen/src/constant_hash.rs similarity index 93% rename from lib/cretonne/src/constant_hash.rs rename to lib/codegen/src/constant_hash.rs index 0dd2895ad3..2bfeaf58c3 100644 --- a/lib/cretonne/src/constant_hash.rs +++ b/lib/codegen/src/constant_hash.rs @@ -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 + ?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() { diff --git a/lib/cretonne/src/context.rs b/lib/codegen/src/context.rs similarity index 100% rename from lib/cretonne/src/context.rs rename to lib/codegen/src/context.rs diff --git a/lib/cretonne/src/cursor.rs b/lib/codegen/src/cursor.rs similarity index 93% rename from lib/cretonne/src/cursor.rs rename to lib/codegen/src/cursor.rs index 865530341d..6842d8b348 100644 --- a/lib/cretonne/src/cursor.rs +++ b/lib/codegen/src/cursor.rs @@ -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() { diff --git a/lib/cretonne/src/dbg.rs b/lib/codegen/src/dbg.rs similarity index 100% rename from lib/cretonne/src/dbg.rs rename to lib/codegen/src/dbg.rs diff --git a/lib/cretonne/src/dce.rs b/lib/codegen/src/dce.rs similarity index 100% rename from lib/cretonne/src/dce.rs rename to lib/codegen/src/dce.rs diff --git a/lib/cretonne/src/divconst_magic_numbers.rs b/lib/codegen/src/divconst_magic_numbers.rs similarity index 100% rename from lib/cretonne/src/divconst_magic_numbers.rs rename to lib/codegen/src/divconst_magic_numbers.rs diff --git a/lib/cretonne/src/dominator_tree.rs b/lib/codegen/src/dominator_tree.rs similarity index 100% rename from lib/cretonne/src/dominator_tree.rs rename to lib/codegen/src/dominator_tree.rs diff --git a/lib/cretonne/src/flowgraph.rs b/lib/codegen/src/flowgraph.rs similarity index 100% rename from lib/cretonne/src/flowgraph.rs rename to lib/codegen/src/flowgraph.rs diff --git a/lib/cretonne/src/ir/builder.rs b/lib/codegen/src/ir/builder.rs similarity index 99% rename from lib/cretonne/src/ir/builder.rs rename to lib/codegen/src/ir/builder.rs index 34f56b9439..e27cda0bcd 100644 --- a/lib/cretonne/src/ir/builder.rs +++ b/lib/codegen/src/ir/builder.rs @@ -32,7 +32,7 @@ pub trait InstBuilderBase<'f>: Sized { fn build(self, data: InstructionData, ctrl_typevar: Type) -> (Inst, &'f mut DataFlowGraph); } -// Include trait code generated by `lib/cretonne/meta/gen_instr.py`. +// Include trait code generated by `lib/codegen/meta/gen_instr.py`. // // This file defines the `InstBuilder` trait as an extension of `InstBuilderBase` with methods per // instruction format and per opcode. diff --git a/lib/cretonne/src/ir/condcodes.rs b/lib/codegen/src/ir/condcodes.rs similarity index 100% rename from lib/cretonne/src/ir/condcodes.rs rename to lib/codegen/src/ir/condcodes.rs diff --git a/lib/cretonne/src/ir/dfg.rs b/lib/codegen/src/ir/dfg.rs similarity index 100% rename from lib/cretonne/src/ir/dfg.rs rename to lib/codegen/src/ir/dfg.rs diff --git a/lib/cretonne/src/ir/entities.rs b/lib/codegen/src/ir/entities.rs similarity index 100% rename from lib/cretonne/src/ir/entities.rs rename to lib/codegen/src/ir/entities.rs diff --git a/lib/cretonne/src/ir/extfunc.rs b/lib/codegen/src/ir/extfunc.rs similarity index 100% rename from lib/cretonne/src/ir/extfunc.rs rename to lib/codegen/src/ir/extfunc.rs diff --git a/lib/cretonne/src/ir/extname.rs b/lib/codegen/src/ir/extname.rs similarity index 96% rename from lib/cretonne/src/ir/extname.rs rename to lib/codegen/src/ir/extname.rs index b37e40086c..f3a69f7e7a 100644 --- a/lib/cretonne/src/ir/extname.rs +++ b/lib/codegen/src/ir/extname.rs @@ -16,7 +16,8 @@ const TESTCASE_NAME_LENGTH: usize = 16; /// to keep track of a sy mbol table. /// /// External names are primarily used as keys by code using Cretonne to map -/// from a `cretonne::ir::FuncRef` or similar to additional associated data. +/// from a `cretonne_codegen::ir::FuncRef` or similar to additional associated +/// data. /// /// External names can also serve as a primitive testing and debugging tool. /// In particular, many `.cton` test files use function names to identify @@ -50,7 +51,7 @@ impl ExternalName { /// # Examples /// /// ```rust - /// # use cretonne::ir::ExternalName; + /// # use cretonne_codegen::ir::ExternalName; /// // Create `ExternalName` from a string. /// let name = ExternalName::testcase("hello"); /// assert_eq!(name.to_string(), "%hello"); @@ -71,7 +72,7 @@ impl ExternalName { /// /// # Examples /// ```rust - /// # use cretonne::ir::ExternalName; + /// # use cretonne_codegen::ir::ExternalName; /// // Create `ExternalName` from integer indicies /// let name = ExternalName::user(123, 456); /// assert_eq!(name.to_string(), "u123:456"); diff --git a/lib/cretonne/src/ir/function.rs b/lib/codegen/src/ir/function.rs similarity index 100% rename from lib/cretonne/src/ir/function.rs rename to lib/codegen/src/ir/function.rs diff --git a/lib/cretonne/src/ir/globalvar.rs b/lib/codegen/src/ir/globalvar.rs similarity index 100% rename from lib/cretonne/src/ir/globalvar.rs rename to lib/codegen/src/ir/globalvar.rs diff --git a/lib/cretonne/src/ir/heap.rs b/lib/codegen/src/ir/heap.rs similarity index 100% rename from lib/cretonne/src/ir/heap.rs rename to lib/codegen/src/ir/heap.rs diff --git a/lib/cretonne/src/ir/immediates.rs b/lib/codegen/src/ir/immediates.rs similarity index 100% rename from lib/cretonne/src/ir/immediates.rs rename to lib/codegen/src/ir/immediates.rs diff --git a/lib/cretonne/src/ir/instructions.rs b/lib/codegen/src/ir/instructions.rs similarity index 99% rename from lib/cretonne/src/ir/instructions.rs rename to lib/codegen/src/ir/instructions.rs index aa6a35df3f..ff415af22b 100644 --- a/lib/cretonne/src/ir/instructions.rs +++ b/lib/codegen/src/ir/instructions.rs @@ -28,7 +28,7 @@ pub type ValueList = entity::EntityList; /// Memory pool for holding value lists. See `ValueList`. pub type ValueListPool = entity::ListPool; -// Include code generated by `lib/cretonne/meta/gen_instr.py`. This file contains: +// Include code generated by `lib/codegen/meta/gen_instr.py`. This file contains: // // - The `pub enum InstructionFormat` enum with all the instruction formats. // - The `pub enum InstructionData` enum with all the instruction data fields. diff --git a/lib/cretonne/src/ir/jumptable.rs b/lib/codegen/src/ir/jumptable.rs similarity index 100% rename from lib/cretonne/src/ir/jumptable.rs rename to lib/codegen/src/ir/jumptable.rs diff --git a/lib/cretonne/src/ir/layout.rs b/lib/codegen/src/ir/layout.rs similarity index 100% rename from lib/cretonne/src/ir/layout.rs rename to lib/codegen/src/ir/layout.rs diff --git a/lib/cretonne/src/ir/libcall.rs b/lib/codegen/src/ir/libcall.rs similarity index 100% rename from lib/cretonne/src/ir/libcall.rs rename to lib/codegen/src/ir/libcall.rs diff --git a/lib/cretonne/src/ir/memflags.rs b/lib/codegen/src/ir/memflags.rs similarity index 100% rename from lib/cretonne/src/ir/memflags.rs rename to lib/codegen/src/ir/memflags.rs diff --git a/lib/cretonne/src/ir/mod.rs b/lib/codegen/src/ir/mod.rs similarity index 100% rename from lib/cretonne/src/ir/mod.rs rename to lib/codegen/src/ir/mod.rs diff --git a/lib/cretonne/src/ir/progpoint.rs b/lib/codegen/src/ir/progpoint.rs similarity index 100% rename from lib/cretonne/src/ir/progpoint.rs rename to lib/codegen/src/ir/progpoint.rs diff --git a/lib/cretonne/src/ir/sourceloc.rs b/lib/codegen/src/ir/sourceloc.rs similarity index 100% rename from lib/cretonne/src/ir/sourceloc.rs rename to lib/codegen/src/ir/sourceloc.rs diff --git a/lib/cretonne/src/ir/stackslot.rs b/lib/codegen/src/ir/stackslot.rs similarity index 100% rename from lib/cretonne/src/ir/stackslot.rs rename to lib/codegen/src/ir/stackslot.rs diff --git a/lib/cretonne/src/ir/trapcode.rs b/lib/codegen/src/ir/trapcode.rs similarity index 100% rename from lib/cretonne/src/ir/trapcode.rs rename to lib/codegen/src/ir/trapcode.rs diff --git a/lib/cretonne/src/ir/types.rs b/lib/codegen/src/ir/types.rs similarity index 99% rename from lib/cretonne/src/ir/types.rs rename to lib/codegen/src/ir/types.rs index 496312b1c4..3dc71454de 100644 --- a/lib/cretonne/src/ir/types.rs +++ b/lib/codegen/src/ir/types.rs @@ -30,7 +30,7 @@ const LANE_BASE: u8 = 0x70; /// Start of the 2-lane vector types. const VECTOR_BASE: u8 = LANE_BASE + 16; -// Include code generated by `lib/cretonne/meta/gen_types.py`. This file contains constant +// Include code generated by `lib/codegen/meta/gen_types.py`. This file contains constant // definitions for all the scalar types as well as common vector types for 64, 128, 256, and // 512-bit SIMD vectors. include!(concat!(env!("OUT_DIR"), "/types.rs")); diff --git a/lib/cretonne/src/ir/valueloc.rs b/lib/codegen/src/ir/valueloc.rs similarity index 100% rename from lib/cretonne/src/ir/valueloc.rs rename to lib/codegen/src/ir/valueloc.rs diff --git a/lib/cretonne/src/isa/arm32/abi.rs b/lib/codegen/src/isa/arm32/abi.rs similarity index 100% rename from lib/cretonne/src/isa/arm32/abi.rs rename to lib/codegen/src/isa/arm32/abi.rs diff --git a/lib/cretonne/src/isa/arm32/binemit.rs b/lib/codegen/src/isa/arm32/binemit.rs similarity index 100% rename from lib/cretonne/src/isa/arm32/binemit.rs rename to lib/codegen/src/isa/arm32/binemit.rs diff --git a/lib/cretonne/src/isa/arm32/enc_tables.rs b/lib/codegen/src/isa/arm32/enc_tables.rs similarity index 100% rename from lib/cretonne/src/isa/arm32/enc_tables.rs rename to lib/codegen/src/isa/arm32/enc_tables.rs diff --git a/lib/cretonne/src/isa/arm32/mod.rs b/lib/codegen/src/isa/arm32/mod.rs similarity index 100% rename from lib/cretonne/src/isa/arm32/mod.rs rename to lib/codegen/src/isa/arm32/mod.rs diff --git a/lib/cretonne/src/isa/arm32/registers.rs b/lib/codegen/src/isa/arm32/registers.rs similarity index 100% rename from lib/cretonne/src/isa/arm32/registers.rs rename to lib/codegen/src/isa/arm32/registers.rs diff --git a/lib/cretonne/src/isa/arm32/settings.rs b/lib/codegen/src/isa/arm32/settings.rs similarity index 58% rename from lib/cretonne/src/isa/arm32/settings.rs rename to lib/codegen/src/isa/arm32/settings.rs index b502deee40..ed7dd01281 100644 --- a/lib/cretonne/src/isa/arm32/settings.rs +++ b/lib/codegen/src/isa/arm32/settings.rs @@ -3,7 +3,7 @@ use settings::{self, detail, Builder}; use std::fmt; -// Include code generated by `lib/cretonne/meta/gen_settings.py`. This file contains a public +// Include code generated by `lib/codegen/meta/gen_settings.py`. This file contains a public // `Flags` struct with an impl for all of the settings defined in -// `lib/cretonne/meta/isa/arm32/settings.py`. +// `lib/codegen/meta/isa/arm32/settings.py`. include!(concat!(env!("OUT_DIR"), "/settings-arm32.rs")); diff --git a/lib/cretonne/src/isa/arm64/abi.rs b/lib/codegen/src/isa/arm64/abi.rs similarity index 100% rename from lib/cretonne/src/isa/arm64/abi.rs rename to lib/codegen/src/isa/arm64/abi.rs diff --git a/lib/cretonne/src/isa/arm64/binemit.rs b/lib/codegen/src/isa/arm64/binemit.rs similarity index 100% rename from lib/cretonne/src/isa/arm64/binemit.rs rename to lib/codegen/src/isa/arm64/binemit.rs diff --git a/lib/cretonne/src/isa/arm64/enc_tables.rs b/lib/codegen/src/isa/arm64/enc_tables.rs similarity index 100% rename from lib/cretonne/src/isa/arm64/enc_tables.rs rename to lib/codegen/src/isa/arm64/enc_tables.rs diff --git a/lib/cretonne/src/isa/arm64/mod.rs b/lib/codegen/src/isa/arm64/mod.rs similarity index 100% rename from lib/cretonne/src/isa/arm64/mod.rs rename to lib/codegen/src/isa/arm64/mod.rs diff --git a/lib/cretonne/src/isa/arm64/registers.rs b/lib/codegen/src/isa/arm64/registers.rs similarity index 100% rename from lib/cretonne/src/isa/arm64/registers.rs rename to lib/codegen/src/isa/arm64/registers.rs diff --git a/lib/cretonne/src/isa/arm64/settings.rs b/lib/codegen/src/isa/arm64/settings.rs similarity index 58% rename from lib/cretonne/src/isa/arm64/settings.rs rename to lib/codegen/src/isa/arm64/settings.rs index b575168361..cdaa129b2d 100644 --- a/lib/cretonne/src/isa/arm64/settings.rs +++ b/lib/codegen/src/isa/arm64/settings.rs @@ -3,7 +3,7 @@ use settings::{self, detail, Builder}; use std::fmt; -// Include code generated by `lib/cretonne/meta/gen_settings.py`. This file contains a public +// Include code generated by `lib/codegen/meta/gen_settings.py`. This file contains a public // `Flags` struct with an impl for all of the settings defined in -// `lib/cretonne/meta/isa/arm64/settings.py`. +// `lib/codegen/meta/isa/arm64/settings.py`. include!(concat!(env!("OUT_DIR"), "/settings-arm64.rs")); diff --git a/lib/cretonne/src/isa/constraints.rs b/lib/codegen/src/isa/constraints.rs similarity index 100% rename from lib/cretonne/src/isa/constraints.rs rename to lib/codegen/src/isa/constraints.rs diff --git a/lib/cretonne/src/isa/enc_tables.rs b/lib/codegen/src/isa/enc_tables.rs similarity index 99% rename from lib/cretonne/src/isa/enc_tables.rs rename to lib/codegen/src/isa/enc_tables.rs index b4c9bd86ba..b3deb85de1 100644 --- a/lib/cretonne/src/isa/enc_tables.rs +++ b/lib/codegen/src/isa/enc_tables.rs @@ -1,7 +1,7 @@ //! Support types for generated encoding tables. //! //! This module contains types and functions for working with the encoding tables generated by -//! `lib/cretonne/meta/gen_encoding.py`. +//! `lib/codegen/meta/gen_encoding.py`. use constant_hash::{probe, Table}; use ir::{Function, InstructionData, Opcode, Type}; diff --git a/lib/cretonne/src/isa/encoding.rs b/lib/codegen/src/isa/encoding.rs similarity index 100% rename from lib/cretonne/src/isa/encoding.rs rename to lib/codegen/src/isa/encoding.rs diff --git a/lib/cretonne/src/isa/mod.rs b/lib/codegen/src/isa/mod.rs similarity index 99% rename from lib/cretonne/src/isa/mod.rs rename to lib/codegen/src/isa/mod.rs index d851d8d9a0..a8d8616858 100644 --- a/lib/cretonne/src/isa/mod.rs +++ b/lib/codegen/src/isa/mod.rs @@ -20,8 +20,8 @@ //! appropriate for the requested ISA: //! //! ``` -//! use cretonne::settings::{self, Configurable}; -//! use cretonne::isa; +//! use cretonne_codegen::settings::{self, Configurable}; +//! use cretonne_codegen::isa; //! //! let shared_builder = settings::builder(); //! let shared_flags = settings::Flags::new(&shared_builder); diff --git a/lib/cretonne/src/isa/registers.rs b/lib/codegen/src/isa/registers.rs similarity index 100% rename from lib/cretonne/src/isa/registers.rs rename to lib/codegen/src/isa/registers.rs diff --git a/lib/cretonne/src/isa/riscv/abi.rs b/lib/codegen/src/isa/riscv/abi.rs similarity index 100% rename from lib/cretonne/src/isa/riscv/abi.rs rename to lib/codegen/src/isa/riscv/abi.rs diff --git a/lib/cretonne/src/isa/riscv/binemit.rs b/lib/codegen/src/isa/riscv/binemit.rs similarity index 100% rename from lib/cretonne/src/isa/riscv/binemit.rs rename to lib/codegen/src/isa/riscv/binemit.rs diff --git a/lib/cretonne/src/isa/riscv/enc_tables.rs b/lib/codegen/src/isa/riscv/enc_tables.rs similarity index 100% rename from lib/cretonne/src/isa/riscv/enc_tables.rs rename to lib/codegen/src/isa/riscv/enc_tables.rs diff --git a/lib/cretonne/src/isa/riscv/mod.rs b/lib/codegen/src/isa/riscv/mod.rs similarity index 100% rename from lib/cretonne/src/isa/riscv/mod.rs rename to lib/codegen/src/isa/riscv/mod.rs diff --git a/lib/cretonne/src/isa/riscv/registers.rs b/lib/codegen/src/isa/riscv/registers.rs similarity index 100% rename from lib/cretonne/src/isa/riscv/registers.rs rename to lib/codegen/src/isa/riscv/registers.rs diff --git a/lib/cretonne/src/isa/riscv/settings.rs b/lib/codegen/src/isa/riscv/settings.rs similarity index 91% rename from lib/cretonne/src/isa/riscv/settings.rs rename to lib/codegen/src/isa/riscv/settings.rs index 27cba43f2f..4a127b578a 100644 --- a/lib/cretonne/src/isa/riscv/settings.rs +++ b/lib/codegen/src/isa/riscv/settings.rs @@ -3,9 +3,9 @@ use settings::{self, detail, Builder}; use std::fmt; -// Include code generated by `lib/cretonne/meta/gen_settings.py`. This file contains a public +// Include code generated by `lib/codegen/meta/gen_settings.py`. This file contains a public // `Flags` struct with an impl for all of the settings defined in -// `lib/cretonne/meta/isa/riscv/settings.py`. +// `lib/codegen/meta/isa/riscv/settings.py`. include!(concat!(env!("OUT_DIR"), "/settings-riscv.rs")); #[cfg(test)] diff --git a/lib/cretonne/src/isa/stack.rs b/lib/codegen/src/isa/stack.rs similarity index 100% rename from lib/cretonne/src/isa/stack.rs rename to lib/codegen/src/isa/stack.rs diff --git a/lib/cretonne/src/isa/x86/abi.rs b/lib/codegen/src/isa/x86/abi.rs similarity index 100% rename from lib/cretonne/src/isa/x86/abi.rs rename to lib/codegen/src/isa/x86/abi.rs diff --git a/lib/cretonne/src/isa/x86/binemit.rs b/lib/codegen/src/isa/x86/binemit.rs similarity index 100% rename from lib/cretonne/src/isa/x86/binemit.rs rename to lib/codegen/src/isa/x86/binemit.rs diff --git a/lib/cretonne/src/isa/x86/enc_tables.rs b/lib/codegen/src/isa/x86/enc_tables.rs similarity index 100% rename from lib/cretonne/src/isa/x86/enc_tables.rs rename to lib/codegen/src/isa/x86/enc_tables.rs diff --git a/lib/cretonne/src/isa/x86/mod.rs b/lib/codegen/src/isa/x86/mod.rs similarity index 100% rename from lib/cretonne/src/isa/x86/mod.rs rename to lib/codegen/src/isa/x86/mod.rs diff --git a/lib/cretonne/src/isa/x86/registers.rs b/lib/codegen/src/isa/x86/registers.rs similarity index 100% rename from lib/cretonne/src/isa/x86/registers.rs rename to lib/codegen/src/isa/x86/registers.rs diff --git a/lib/cretonne/src/isa/x86/settings.rs b/lib/codegen/src/isa/x86/settings.rs similarity index 91% rename from lib/cretonne/src/isa/x86/settings.rs rename to lib/codegen/src/isa/x86/settings.rs index 8bcf75249b..379f0db493 100644 --- a/lib/cretonne/src/isa/x86/settings.rs +++ b/lib/codegen/src/isa/x86/settings.rs @@ -3,9 +3,9 @@ use settings::{self, detail, Builder}; use std::fmt; -// Include code generated by `lib/cretonne/meta/gen_settings.py`. This file contains a public +// Include code generated by `lib/codegen/meta/gen_settings.py`. This file contains a public // `Flags` struct with an impl for all of the settings defined in -// `lib/cretonne/meta/isa/x86/settings.py`. +// `lib/codegen/meta/isa/x86/settings.py`. include!(concat!(env!("OUT_DIR"), "/settings-x86.rs")); #[cfg(test)] diff --git a/lib/cretonne/src/iterators.rs b/lib/codegen/src/iterators.rs similarity index 100% rename from lib/cretonne/src/iterators.rs rename to lib/codegen/src/iterators.rs diff --git a/lib/cretonne/src/legalizer/boundary.rs b/lib/codegen/src/legalizer/boundary.rs similarity index 100% rename from lib/cretonne/src/legalizer/boundary.rs rename to lib/codegen/src/legalizer/boundary.rs diff --git a/lib/cretonne/src/legalizer/call.rs b/lib/codegen/src/legalizer/call.rs similarity index 100% rename from lib/cretonne/src/legalizer/call.rs rename to lib/codegen/src/legalizer/call.rs diff --git a/lib/cretonne/src/legalizer/globalvar.rs b/lib/codegen/src/legalizer/globalvar.rs similarity index 100% rename from lib/cretonne/src/legalizer/globalvar.rs rename to lib/codegen/src/legalizer/globalvar.rs diff --git a/lib/cretonne/src/legalizer/heap.rs b/lib/codegen/src/legalizer/heap.rs similarity index 100% rename from lib/cretonne/src/legalizer/heap.rs rename to lib/codegen/src/legalizer/heap.rs diff --git a/lib/cretonne/src/legalizer/libcall.rs b/lib/codegen/src/legalizer/libcall.rs similarity index 100% rename from lib/cretonne/src/legalizer/libcall.rs rename to lib/codegen/src/legalizer/libcall.rs diff --git a/lib/cretonne/src/legalizer/mod.rs b/lib/codegen/src/legalizer/mod.rs similarity index 99% rename from lib/cretonne/src/legalizer/mod.rs rename to lib/codegen/src/legalizer/mod.rs index 4486d5df4e..f4f9389390 100644 --- a/lib/cretonne/src/legalizer/mod.rs +++ b/lib/codegen/src/legalizer/mod.rs @@ -105,7 +105,7 @@ pub fn legalize_function(func: &mut ir::Function, cfg: &mut ControlFlowGraph, is } // Include legalization patterns that were generated by `gen_legalizer.py` from the `XForms` in -// `lib/cretonne/meta/base/legalize.py`. +// `lib/codegen/meta/base/legalize.py`. // // Concretely, this defines private functions `narrow()`, and `expand()`. include!(concat!(env!("OUT_DIR"), "/legalizer.rs")); diff --git a/lib/cretonne/src/legalizer/split.rs b/lib/codegen/src/legalizer/split.rs similarity index 100% rename from lib/cretonne/src/legalizer/split.rs rename to lib/codegen/src/legalizer/split.rs diff --git a/lib/cretonne/src/lib.rs b/lib/codegen/src/lib.rs similarity index 97% rename from lib/cretonne/src/lib.rs rename to lib/codegen/src/lib.rs index 8bc88ab420..8860cb2e69 100644 --- a/lib/cretonne/src/lib.rs +++ b/lib/codegen/src/lib.rs @@ -35,7 +35,7 @@ pub use legalizer::legalize_function; pub use verifier::verify_function; pub use write::write_function; -/// Version number of the cretonne crate. +/// Version number of the cretonne-codegen crate. pub const VERSION: &str = env!("CARGO_PKG_VERSION"); #[macro_use] diff --git a/lib/cretonne/src/licm.rs b/lib/codegen/src/licm.rs similarity index 100% rename from lib/cretonne/src/licm.rs rename to lib/codegen/src/licm.rs diff --git a/lib/cretonne/src/loop_analysis.rs b/lib/codegen/src/loop_analysis.rs similarity index 100% rename from lib/cretonne/src/loop_analysis.rs rename to lib/codegen/src/loop_analysis.rs diff --git a/lib/cretonne/src/partition_slice.rs b/lib/codegen/src/partition_slice.rs similarity index 100% rename from lib/cretonne/src/partition_slice.rs rename to lib/codegen/src/partition_slice.rs diff --git a/lib/cretonne/src/postopt.rs b/lib/codegen/src/postopt.rs similarity index 100% rename from lib/cretonne/src/postopt.rs rename to lib/codegen/src/postopt.rs diff --git a/lib/cretonne/src/predicates.rs b/lib/codegen/src/predicates.rs similarity index 98% rename from lib/cretonne/src/predicates.rs rename to lib/codegen/src/predicates.rs index 333ca8eb31..e35e7ad179 100644 --- a/lib/cretonne/src/predicates.rs +++ b/lib/codegen/src/predicates.rs @@ -1,7 +1,7 @@ //! Predicate functions for testing instruction fields. //! //! This module defines functions that are used by the instruction predicates defined by -//! `lib/cretonne/meta/cdsl/predicates.py` classes. +//! `lib/codegen/meta/cdsl/predicates.py` classes. //! //! The predicates the operate on integer fields use `Into` as a shared trait bound. This //! bound is implemented by all the native integer types as well as `Imm64`. diff --git a/lib/cretonne/src/preopt.rs b/lib/codegen/src/preopt.rs similarity index 100% rename from lib/cretonne/src/preopt.rs rename to lib/codegen/src/preopt.rs diff --git a/lib/cretonne/src/print_errors.rs b/lib/codegen/src/print_errors.rs similarity index 100% rename from lib/cretonne/src/print_errors.rs rename to lib/codegen/src/print_errors.rs diff --git a/lib/cretonne/src/ref_slice.rs b/lib/codegen/src/ref_slice.rs similarity index 100% rename from lib/cretonne/src/ref_slice.rs rename to lib/codegen/src/ref_slice.rs diff --git a/lib/cretonne/src/regalloc/affinity.rs b/lib/codegen/src/regalloc/affinity.rs similarity index 100% rename from lib/cretonne/src/regalloc/affinity.rs rename to lib/codegen/src/regalloc/affinity.rs diff --git a/lib/cretonne/src/regalloc/coalescing.rs b/lib/codegen/src/regalloc/coalescing.rs similarity index 100% rename from lib/cretonne/src/regalloc/coalescing.rs rename to lib/codegen/src/regalloc/coalescing.rs diff --git a/lib/cretonne/src/regalloc/coloring.rs b/lib/codegen/src/regalloc/coloring.rs similarity index 100% rename from lib/cretonne/src/regalloc/coloring.rs rename to lib/codegen/src/regalloc/coloring.rs diff --git a/lib/cretonne/src/regalloc/context.rs b/lib/codegen/src/regalloc/context.rs similarity index 100% rename from lib/cretonne/src/regalloc/context.rs rename to lib/codegen/src/regalloc/context.rs diff --git a/lib/cretonne/src/regalloc/diversion.rs b/lib/codegen/src/regalloc/diversion.rs similarity index 100% rename from lib/cretonne/src/regalloc/diversion.rs rename to lib/codegen/src/regalloc/diversion.rs diff --git a/lib/cretonne/src/regalloc/live_value_tracker.rs b/lib/codegen/src/regalloc/live_value_tracker.rs similarity index 100% rename from lib/cretonne/src/regalloc/live_value_tracker.rs rename to lib/codegen/src/regalloc/live_value_tracker.rs diff --git a/lib/cretonne/src/regalloc/liveness.rs b/lib/codegen/src/regalloc/liveness.rs similarity index 100% rename from lib/cretonne/src/regalloc/liveness.rs rename to lib/codegen/src/regalloc/liveness.rs diff --git a/lib/cretonne/src/regalloc/liverange.rs b/lib/codegen/src/regalloc/liverange.rs similarity index 100% rename from lib/cretonne/src/regalloc/liverange.rs rename to lib/codegen/src/regalloc/liverange.rs diff --git a/lib/cretonne/src/regalloc/mod.rs b/lib/codegen/src/regalloc/mod.rs similarity index 100% rename from lib/cretonne/src/regalloc/mod.rs rename to lib/codegen/src/regalloc/mod.rs diff --git a/lib/cretonne/src/regalloc/pressure.rs b/lib/codegen/src/regalloc/pressure.rs similarity index 100% rename from lib/cretonne/src/regalloc/pressure.rs rename to lib/codegen/src/regalloc/pressure.rs diff --git a/lib/cretonne/src/regalloc/register_set.rs b/lib/codegen/src/regalloc/register_set.rs similarity index 100% rename from lib/cretonne/src/regalloc/register_set.rs rename to lib/codegen/src/regalloc/register_set.rs diff --git a/lib/cretonne/src/regalloc/reload.rs b/lib/codegen/src/regalloc/reload.rs similarity index 100% rename from lib/cretonne/src/regalloc/reload.rs rename to lib/codegen/src/regalloc/reload.rs diff --git a/lib/cretonne/src/regalloc/solver.rs b/lib/codegen/src/regalloc/solver.rs similarity index 100% rename from lib/cretonne/src/regalloc/solver.rs rename to lib/codegen/src/regalloc/solver.rs diff --git a/lib/cretonne/src/regalloc/spilling.rs b/lib/codegen/src/regalloc/spilling.rs similarity index 100% rename from lib/cretonne/src/regalloc/spilling.rs rename to lib/codegen/src/regalloc/spilling.rs diff --git a/lib/cretonne/src/regalloc/virtregs.rs b/lib/codegen/src/regalloc/virtregs.rs similarity index 100% rename from lib/cretonne/src/regalloc/virtregs.rs rename to lib/codegen/src/regalloc/virtregs.rs diff --git a/lib/cretonne/src/result.rs b/lib/codegen/src/result.rs similarity index 100% rename from lib/cretonne/src/result.rs rename to lib/codegen/src/result.rs diff --git a/lib/cretonne/src/scoped_hash_map.rs b/lib/codegen/src/scoped_hash_map.rs similarity index 100% rename from lib/cretonne/src/scoped_hash_map.rs rename to lib/codegen/src/scoped_hash_map.rs diff --git a/lib/cretonne/src/settings.rs b/lib/codegen/src/settings.rs similarity index 98% rename from lib/cretonne/src/settings.rs rename to lib/codegen/src/settings.rs index aee441f3ca..6db7ef402e 100644 --- a/lib/cretonne/src/settings.rs +++ b/lib/codegen/src/settings.rs @@ -11,7 +11,7 @@ //! //! # Example //! ``` -//! use cretonne::settings::{self, Configurable}; +//! use cretonne_codegen::settings::{self, Configurable}; //! //! let mut b = settings::builder(); //! b.set("opt_level", "fastest"); @@ -312,7 +312,7 @@ pub mod detail { } // Include code generated by `meta/gen_settings.py`. This file contains a public `Flags` struct -// with an impl for all of the settings defined in `lib/cretonne/meta/base/settings.py`. +// with an impl for all of the settings defined in `lib/codegen/meta/base/settings.py`. include!(concat!(env!("OUT_DIR"), "/settings.rs")); /// Wrapper containing flags and optionally a `TargetIsa` trait object. diff --git a/lib/cretonne/src/simple_gvn.rs b/lib/codegen/src/simple_gvn.rs similarity index 100% rename from lib/cretonne/src/simple_gvn.rs rename to lib/codegen/src/simple_gvn.rs diff --git a/lib/cretonne/src/stack_layout.rs b/lib/codegen/src/stack_layout.rs similarity index 100% rename from lib/cretonne/src/stack_layout.rs rename to lib/codegen/src/stack_layout.rs diff --git a/lib/cretonne/src/timing.rs b/lib/codegen/src/timing.rs similarity index 100% rename from lib/cretonne/src/timing.rs rename to lib/codegen/src/timing.rs diff --git a/lib/cretonne/src/topo_order.rs b/lib/codegen/src/topo_order.rs similarity index 100% rename from lib/cretonne/src/topo_order.rs rename to lib/codegen/src/topo_order.rs diff --git a/lib/cretonne/src/unreachable_code.rs b/lib/codegen/src/unreachable_code.rs similarity index 100% rename from lib/cretonne/src/unreachable_code.rs rename to lib/codegen/src/unreachable_code.rs diff --git a/lib/cretonne/src/verifier/cssa.rs b/lib/codegen/src/verifier/cssa.rs similarity index 100% rename from lib/cretonne/src/verifier/cssa.rs rename to lib/codegen/src/verifier/cssa.rs diff --git a/lib/cretonne/src/verifier/flags.rs b/lib/codegen/src/verifier/flags.rs similarity index 100% rename from lib/cretonne/src/verifier/flags.rs rename to lib/codegen/src/verifier/flags.rs diff --git a/lib/cretonne/src/verifier/liveness.rs b/lib/codegen/src/verifier/liveness.rs similarity index 100% rename from lib/cretonne/src/verifier/liveness.rs rename to lib/codegen/src/verifier/liveness.rs diff --git a/lib/cretonne/src/verifier/locations.rs b/lib/codegen/src/verifier/locations.rs similarity index 100% rename from lib/cretonne/src/verifier/locations.rs rename to lib/codegen/src/verifier/locations.rs diff --git a/lib/cretonne/src/verifier/mod.rs b/lib/codegen/src/verifier/mod.rs similarity index 100% rename from lib/cretonne/src/verifier/mod.rs rename to lib/codegen/src/verifier/mod.rs diff --git a/lib/cretonne/src/write.rs b/lib/codegen/src/write.rs similarity index 100% rename from lib/cretonne/src/write.rs rename to lib/codegen/src/write.rs diff --git a/lib/filetests/Cargo.toml b/lib/filetests/Cargo.toml index e0187f3f75..984d5e0629 100644 --- a/lib/filetests/Cargo.toml +++ b/lib/filetests/Cargo.toml @@ -9,7 +9,7 @@ repository = "https://github.com/Cretonne/cretonne" publish = false [dependencies] -cretonne = { path = "../cretonne", version = "0.4.4" } +cretonne-codegen = { path = "../codegen", version = "0.4.4" } cretonne-reader = { path = "../reader", version = "0.4.4" } filecheck = "0.3.0" num_cpus = "1.8.0" diff --git a/lib/filetests/src/concurrent.rs b/lib/filetests/src/concurrent.rs index 7ca4b01d89..ac45624114 100644 --- a/lib/filetests/src/concurrent.rs +++ b/lib/filetests/src/concurrent.rs @@ -3,7 +3,7 @@ //! This module provides the `ConcurrentRunner` struct which uses a pool of threads to run tests //! concurrently. -use cretonne::timing; +use cretonne_codegen::timing; use num_cpus; use std::panic::catch_unwind; use std::path::{Path, PathBuf}; diff --git a/lib/filetests/src/lib.rs b/lib/filetests/src/lib.rs index d58f15fdc0..df7be54fa6 100644 --- a/lib/filetests/src/lib.rs +++ b/lib/filetests/src/lib.rs @@ -9,7 +9,7 @@ block_in_if_condition_stmt))] #[macro_use(dbg)] -extern crate cretonne; +extern crate cretonne_codegen; extern crate cretonne_reader; extern crate filecheck; extern crate num_cpus; diff --git a/lib/filetests/src/runone.rs b/lib/filetests/src/runone.rs index dee5bfc2c9..6d80afffad 100644 --- a/lib/filetests/src/runone.rs +++ b/lib/filetests/src/runone.rs @@ -1,11 +1,11 @@ //! Run the tests in a single test file. -use cretonne::ir::Function; -use cretonne::isa::TargetIsa; -use cretonne::print_errors::pretty_verifier_error; -use cretonne::settings::Flags; -use cretonne::timing; -use cretonne::verify_function; +use cretonne_codegen::ir::Function; +use cretonne_codegen::isa::TargetIsa; +use cretonne_codegen::print_errors::pretty_verifier_error; +use cretonne_codegen::settings::Flags; +use cretonne_codegen::timing; +use cretonne_codegen::verify_function; use cretonne_reader::IsaSpec; use cretonne_reader::parse_test; use std::borrow::Cow; diff --git a/lib/filetests/src/subtest.rs b/lib/filetests/src/subtest.rs index 4ae71494d7..2ed560cb3f 100644 --- a/lib/filetests/src/subtest.rs +++ b/lib/filetests/src/subtest.rs @@ -1,8 +1,8 @@ //! `SubTest` trait. -use cretonne::ir::Function; -use cretonne::isa::TargetIsa; -use cretonne::settings::{Flags, FlagsOrIsa}; +use cretonne_codegen::ir::Function; +use cretonne_codegen::isa::TargetIsa; +use cretonne_codegen::settings::{Flags, FlagsOrIsa}; use cretonne_reader::{Comment, Details}; use filecheck::{Checker, CheckerBuilder, NO_VARIABLES}; use std::borrow::Cow; diff --git a/lib/filetests/src/test_binemit.rs b/lib/filetests/src/test_binemit.rs index 620eb7e9f3..86058673e3 100644 --- a/lib/filetests/src/test_binemit.rs +++ b/lib/filetests/src/test_binemit.rs @@ -3,12 +3,12 @@ //! The `binemit` test command generates binary machine code for every instruction in the input //! functions and compares the results to the expected output. -use cretonne::binemit; -use cretonne::binemit::RegDiversions; -use cretonne::dbg::DisplayList; -use cretonne::ir; -use cretonne::ir::entities::AnyEntity; -use cretonne::print_errors::pretty_error; +use cretonne_codegen::binemit; +use cretonne_codegen::binemit::RegDiversions; +use cretonne_codegen::dbg::DisplayList; +use cretonne_codegen::ir; +use cretonne_codegen::ir::entities::AnyEntity; +use cretonne_codegen::print_errors::pretty_error; use cretonne_reader::TestCommand; use match_directive::match_directive; use std::borrow::Cow; diff --git a/lib/filetests/src/test_cat.rs b/lib/filetests/src/test_cat.rs index 3d04fcae3e..4fdedf115f 100644 --- a/lib/filetests/src/test_cat.rs +++ b/lib/filetests/src/test_cat.rs @@ -1,6 +1,6 @@ //! The `cat` subtest. -use cretonne::ir::Function; +use cretonne_codegen::ir::Function; use cretonne_reader::TestCommand; use std::borrow::Cow; use subtest::{self, Context, Result as STResult, SubTest}; diff --git a/lib/filetests/src/test_compile.rs b/lib/filetests/src/test_compile.rs index a5af1f54e7..c4b737bfc6 100644 --- a/lib/filetests/src/test_compile.rs +++ b/lib/filetests/src/test_compile.rs @@ -2,10 +2,9 @@ //! //! The `compile` test command runs each function through the full code generator pipeline -use cretonne; -use cretonne::binemit; -use cretonne::ir; -use cretonne::print_errors::pretty_error; +use cretonne_codegen; +use cretonne_codegen::{binemit, ir}; +use cretonne_codegen::print_errors::pretty_error; use cretonne_reader::TestCommand; use std::borrow::Cow; use std::fmt::Write; @@ -39,7 +38,7 @@ impl SubTest for TestCompile { let isa = context.isa.expect("compile needs an ISA"); // Create a compilation context, and drop in the function. - let mut comp_ctx = cretonne::Context::new(); + let mut comp_ctx = cretonne_codegen::Context::new(); comp_ctx.func = func.into_owned(); let code_size = comp_ctx.compile(isa).map_err(|e| { diff --git a/lib/filetests/src/test_dce.rs b/lib/filetests/src/test_dce.rs index 4d79cea1ce..14d535aca4 100644 --- a/lib/filetests/src/test_dce.rs +++ b/lib/filetests/src/test_dce.rs @@ -5,9 +5,9 @@ //! //! The resulting function is sent to `filecheck`. -use cretonne; -use cretonne::ir::Function; -use cretonne::print_errors::pretty_error; +use cretonne_codegen; +use cretonne_codegen::ir::Function; +use cretonne_codegen::print_errors::pretty_error; use cretonne_reader::TestCommand; use std::borrow::Cow; use std::fmt::Write; @@ -35,7 +35,7 @@ impl SubTest for TestDCE { fn run(&self, func: Cow, context: &Context) -> Result<()> { // Create a compilation context, and drop in the function. - let mut comp_ctx = cretonne::Context::new(); + let mut comp_ctx = cretonne_codegen::Context::new(); comp_ctx.func = func.into_owned(); comp_ctx.flowgraph(); diff --git a/lib/filetests/src/test_domtree.rs b/lib/filetests/src/test_domtree.rs index 9862f3f4fe..9803a67d4e 100644 --- a/lib/filetests/src/test_domtree.rs +++ b/lib/filetests/src/test_domtree.rs @@ -12,10 +12,10 @@ //! We verify that the dominator tree annotations are complete and correct. //! -use cretonne::dominator_tree::{DominatorTree, DominatorTreePreorder}; -use cretonne::flowgraph::ControlFlowGraph; -use cretonne::ir::Function; -use cretonne::ir::entities::AnyEntity; +use cretonne_codegen::dominator_tree::{DominatorTree, DominatorTreePreorder}; +use cretonne_codegen::flowgraph::ControlFlowGraph; +use cretonne_codegen::ir::Function; +use cretonne_codegen::ir::entities::AnyEntity; use cretonne_reader::TestCommand; use match_directive::match_directive; use std::borrow::{Borrow, Cow}; diff --git a/lib/filetests/src/test_legalizer.rs b/lib/filetests/src/test_legalizer.rs index af288bcc8d..cb24ba44a5 100644 --- a/lib/filetests/src/test_legalizer.rs +++ b/lib/filetests/src/test_legalizer.rs @@ -3,9 +3,9 @@ //! The `test legalizer` test command runs each function through `legalize_function()` and sends //! the result to filecheck. -use cretonne; -use cretonne::ir::Function; -use cretonne::print_errors::pretty_error; +use cretonne_codegen; +use cretonne_codegen::ir::Function; +use cretonne_codegen::print_errors::pretty_error; use cretonne_reader::TestCommand; use std::borrow::Cow; use std::fmt::Write; @@ -36,7 +36,7 @@ impl SubTest for TestLegalizer { } fn run(&self, func: Cow, context: &Context) -> Result<()> { - let mut comp_ctx = cretonne::Context::new(); + let mut comp_ctx = cretonne_codegen::Context::new(); comp_ctx.func = func.into_owned(); let isa = context.isa.expect("legalizer needs an ISA"); diff --git a/lib/filetests/src/test_licm.rs b/lib/filetests/src/test_licm.rs index 435b5ab1bc..3add99b1ab 100644 --- a/lib/filetests/src/test_licm.rs +++ b/lib/filetests/src/test_licm.rs @@ -5,9 +5,9 @@ //! //! The resulting function is sent to `filecheck`. -use cretonne; -use cretonne::ir::Function; -use cretonne::print_errors::pretty_error; +use cretonne_codegen; +use cretonne_codegen::ir::Function; +use cretonne_codegen::print_errors::pretty_error; use cretonne_reader::TestCommand; use std::borrow::Cow; use std::fmt::Write; @@ -35,7 +35,7 @@ impl SubTest for TestLICM { fn run(&self, func: Cow, context: &Context) -> Result<()> { // Create a compilation context, and drop in the function. - let mut comp_ctx = cretonne::Context::new(); + let mut comp_ctx = cretonne_codegen::Context::new(); comp_ctx.func = func.into_owned(); comp_ctx.flowgraph(); diff --git a/lib/filetests/src/test_postopt.rs b/lib/filetests/src/test_postopt.rs index b575a36096..14c0060e6d 100644 --- a/lib/filetests/src/test_postopt.rs +++ b/lib/filetests/src/test_postopt.rs @@ -2,9 +2,9 @@ //! //! The resulting function is sent to `filecheck`. -use cretonne; -use cretonne::ir::Function; -use cretonne::print_errors::pretty_error; +use cretonne_codegen; +use cretonne_codegen::ir::Function; +use cretonne_codegen::print_errors::pretty_error; use cretonne_reader::TestCommand; use std::borrow::Cow; use std::fmt::Write; @@ -32,7 +32,7 @@ impl SubTest for TestPostopt { fn run(&self, func: Cow, context: &Context) -> Result<()> { // Create a compilation context, and drop in the function. - let mut comp_ctx = cretonne::Context::new(); + let mut comp_ctx = cretonne_codegen::Context::new(); comp_ctx.func = func.into_owned(); let isa = context.isa.expect("postopt needs an ISA"); diff --git a/lib/filetests/src/test_preopt.rs b/lib/filetests/src/test_preopt.rs index f58d216a26..f4c53ce267 100644 --- a/lib/filetests/src/test_preopt.rs +++ b/lib/filetests/src/test_preopt.rs @@ -2,9 +2,9 @@ //! //! The resulting function is sent to `filecheck`. -use cretonne; -use cretonne::ir::Function; -use cretonne::print_errors::pretty_error; +use cretonne_codegen; +use cretonne_codegen::ir::Function; +use cretonne_codegen::print_errors::pretty_error; use cretonne_reader::TestCommand; use std::borrow::Cow; use std::fmt::Write; @@ -32,7 +32,7 @@ impl SubTest for TestPreopt { fn run(&self, func: Cow, context: &Context) -> Result<()> { // Create a compilation context, and drop in the function. - let mut comp_ctx = cretonne::Context::new(); + let mut comp_ctx = cretonne_codegen::Context::new(); comp_ctx.func = func.into_owned(); let isa = context.isa.expect("preopt needs an ISA"); diff --git a/lib/filetests/src/test_print_cfg.rs b/lib/filetests/src/test_print_cfg.rs index f6388b70fe..3f48b1d4e9 100644 --- a/lib/filetests/src/test_print_cfg.rs +++ b/lib/filetests/src/test_print_cfg.rs @@ -5,8 +5,8 @@ use std::borrow::Cow; -use cretonne::cfg_printer::CFGPrinter; -use cretonne::ir::Function; +use cretonne_codegen::cfg_printer::CFGPrinter; +use cretonne_codegen::ir::Function; use cretonne_reader::TestCommand; use subtest::{self, Context, Result as STResult, SubTest}; diff --git a/lib/filetests/src/test_regalloc.rs b/lib/filetests/src/test_regalloc.rs index 36f3ac169f..5010c84ad4 100644 --- a/lib/filetests/src/test_regalloc.rs +++ b/lib/filetests/src/test_regalloc.rs @@ -5,9 +5,9 @@ //! //! The resulting function is sent to `filecheck`. -use cretonne; -use cretonne::ir::Function; -use cretonne::print_errors::pretty_error; +use cretonne_codegen; +use cretonne_codegen::ir::Function; +use cretonne_codegen::print_errors::pretty_error; use cretonne_reader::TestCommand; use std::borrow::Cow; use std::fmt::Write; @@ -41,7 +41,7 @@ impl SubTest for TestRegalloc { let isa = context.isa.expect("register allocator needs an ISA"); // Create a compilation context, and drop in the function. - let mut comp_ctx = cretonne::Context::new(); + let mut comp_ctx = cretonne_codegen::Context::new(); comp_ctx.func = func.into_owned(); comp_ctx.compute_cfg(); diff --git a/lib/filetests/src/test_simple_gvn.rs b/lib/filetests/src/test_simple_gvn.rs index b60379cff1..467559eecb 100644 --- a/lib/filetests/src/test_simple_gvn.rs +++ b/lib/filetests/src/test_simple_gvn.rs @@ -5,9 +5,9 @@ //! //! The resulting function is sent to `filecheck`. -use cretonne; -use cretonne::ir::Function; -use cretonne::print_errors::pretty_error; +use cretonne_codegen; +use cretonne_codegen::ir::Function; +use cretonne_codegen::print_errors::pretty_error; use cretonne_reader::TestCommand; use std::borrow::Cow; use std::fmt::Write; @@ -35,7 +35,7 @@ impl SubTest for TestSimpleGVN { fn run(&self, func: Cow, context: &Context) -> Result<()> { // Create a compilation context, and drop in the function. - let mut comp_ctx = cretonne::Context::new(); + let mut comp_ctx = cretonne_codegen::Context::new(); comp_ctx.func = func.into_owned(); comp_ctx.flowgraph(); diff --git a/lib/filetests/src/test_verifier.rs b/lib/filetests/src/test_verifier.rs index 0243469630..514e988936 100644 --- a/lib/filetests/src/test_verifier.rs +++ b/lib/filetests/src/test_verifier.rs @@ -9,8 +9,8 @@ //! This annotation means that the verifier is expected to given an error for the jump instruction //! containing the substring "jump to non-existent EBB". -use cretonne::ir::Function; -use cretonne::verify_function; +use cretonne_codegen::ir::Function; +use cretonne_codegen::verify_function; use cretonne_reader::TestCommand; use match_directive::match_directive; use std::borrow::{Borrow, Cow}; diff --git a/lib/frontend/Cargo.toml b/lib/frontend/Cargo.toml index 5dc031926b..77c54a32f0 100644 --- a/lib/frontend/Cargo.toml +++ b/lib/frontend/Cargo.toml @@ -9,7 +9,7 @@ repository = "https://github.com/Cretonne/cretonne" readme = "README.md" [dependencies] -cretonne = { path = "../cretonne", version = "0.4.4" } +cretonne-codegen = { path = "../codegen", version = "0.4.4" } [badges] maintenance = { status = "experimental" } diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs index 4396c4edac..12568582e2 100644 --- a/lib/frontend/src/frontend.rs +++ b/lib/frontend/src/frontend.rs @@ -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) { diff --git a/lib/frontend/src/lib.rs b/lib/frontend/src/lib.rs index 369a4cf13d..8330a062ad 100644 --- a/lib/frontend/src/lib.rs +++ b/lib/frontend/src/lib.rs @@ -32,15 +32,15 @@ //! Here is how you build the corresponding Cretonne IR function using `FunctionBuilderContext`: //! //! ```rust -//! extern crate cretonne; +//! 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 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::verifier::verify_function; +//! use cretonne_codegen::verifier::verify_function; //! //! fn main() { //! let mut sig = Signature::new(CallConv::SystemV); @@ -130,7 +130,7 @@ #![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)] #![cfg_attr(feature = "cargo-clippy", allow(new_without_default, redundant_field_names))] -extern crate cretonne; +extern crate cretonne_codegen; pub use frontend::{FunctionBuilder, FunctionBuilderContext}; pub use variable::Variable; diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index 82e9242b4f..22daff51d2 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -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] diff --git a/lib/frontend/src/variable.rs b/lib/frontend/src/variable.rs index b4e3c75da2..368d4bfb18 100644 --- a/lib/frontend/src/variable.rs +++ b/lib/frontend/src/variable.rs @@ -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. diff --git a/lib/native/Cargo.toml b/lib/native/Cargo.toml index 3c80e45d15..35afe7441f 100644 --- a/lib/native/Cargo.toml +++ b/lib/native/Cargo.toml @@ -8,7 +8,7 @@ license = "Apache-2.0" readme = "README.md" [dependencies] -cretonne = { path = "../cretonne", version = "0.4.4" } +cretonne-codegen = { path = "../codegen", version = "0.4.4" } [target.'cfg(any(target_arch = "x86", target_arch = "x86_64"))'.dependencies] raw-cpuid = "3.0.0" diff --git a/lib/native/src/lib.rs b/lib/native/src/lib.rs index 971abdc4f5..c2504b5c38 100644 --- a/lib/native/src/lib.rs +++ b/lib/native/src/lib.rs @@ -3,13 +3,13 @@ #![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)] -extern crate cretonne; +extern crate cretonne_codegen; #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] extern crate raw_cpuid; -use cretonne::isa; -use cretonne::settings::{self, Configurable}; +use cretonne_codegen::isa; +use cretonne_codegen::settings::{self, Configurable}; #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] use raw_cpuid::CpuId; diff --git a/lib/reader/Cargo.toml b/lib/reader/Cargo.toml index d3a5213cdd..49afaf482a 100644 --- a/lib/reader/Cargo.toml +++ b/lib/reader/Cargo.toml @@ -9,7 +9,7 @@ repository = "https://github.com/Cretonne/cretonne" readme = "README.md" [dependencies] -cretonne = { path = "../cretonne", version = "0.4.4" } +cretonne-codegen = { path = "../codegen", version = "0.4.4" } [badges] maintenance = { status = "experimental" } diff --git a/lib/reader/src/isaspec.rs b/lib/reader/src/isaspec.rs index e87b2b6771..85b08df368 100644 --- a/lib/reader/src/isaspec.rs +++ b/lib/reader/src/isaspec.rs @@ -6,8 +6,8 @@ //! If a test case file contains `isa` commands, the tests will only be run against the specified //! ISAs. If the file contains no `isa` commands, the tests will be run against all supported ISAs. -use cretonne::isa::TargetIsa; -use cretonne::settings::{Configurable, Error as SetError, Flags}; +use cretonne_codegen::isa::TargetIsa; +use cretonne_codegen::settings::{Configurable, Error as SetError, Flags}; use error::{Location, Result}; use testcommand::TestOption; diff --git a/lib/reader/src/lexer.rs b/lib/reader/src/lexer.rs index a2fde86b5a..bad7a6369d 100644 --- a/lib/reader/src/lexer.rs +++ b/lib/reader/src/lexer.rs @@ -1,7 +1,7 @@ //! Lexical analysis for .cton files. -use cretonne::ir::types; -use cretonne::ir::{Ebb, Value}; +use cretonne_codegen::ir::types; +use cretonne_codegen::ir::{Ebb, Value}; use error::Location; #[allow(unused_imports)] use std::ascii::AsciiExt; @@ -457,8 +457,8 @@ impl<'a> Lexer<'a> { mod tests { use super::trailing_digits; use super::*; - use cretonne::ir::types; - use cretonne::ir::{Ebb, Value}; + use cretonne_codegen::ir::types; + use cretonne_codegen::ir::{Ebb, Value}; use error::Location; #[test] diff --git a/lib/reader/src/lib.rs b/lib/reader/src/lib.rs index 8b4b831042..5a51d4199d 100644 --- a/lib/reader/src/lib.rs +++ b/lib/reader/src/lib.rs @@ -5,7 +5,7 @@ #![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)] -extern crate cretonne; +extern crate cretonne_codegen; pub use error::{Error, Location, Result}; pub use isaspec::{parse_options, IsaSpec}; diff --git a/lib/reader/src/parser.rs b/lib/reader/src/parser.rs index 66a66ac18c..88d067112b 100644 --- a/lib/reader/src/parser.rs +++ b/lib/reader/src/parser.rs @@ -1,18 +1,19 @@ //! Parser for .cton files. -use cretonne::entity::EntityRef; -use cretonne::ir; -use cretonne::ir::entities::AnyEntity; -use cretonne::ir::immediates::{Ieee32, Ieee64, Imm64, Offset32, Uimm32}; -use cretonne::ir::instructions::{InstructionData, InstructionFormat, VariableArgs}; -use cretonne::ir::types::VOID; -use cretonne::ir::{AbiParam, ArgumentExtension, ArgumentLoc, CallConv, Ebb, ExtFuncData, - ExternalName, FuncRef, Function, GlobalVar, GlobalVarData, Heap, HeapBase, - HeapData, HeapStyle, JumpTable, JumpTableData, MemFlags, Opcode, SigRef, - Signature, StackSlot, StackSlotData, StackSlotKind, Type, Value, ValueLoc}; -use cretonne::isa::{self, Encoding, RegUnit, TargetIsa}; -use cretonne::packed_option::ReservedValue; -use cretonne::{settings, timing}; +use cretonne_codegen::entity::EntityRef; +use cretonne_codegen::ir; +use cretonne_codegen::ir::entities::AnyEntity; +use cretonne_codegen::ir::immediates::{Ieee32, Ieee64, Imm64, Offset32, Uimm32}; +use cretonne_codegen::ir::instructions::{InstructionData, InstructionFormat, VariableArgs}; +use cretonne_codegen::ir::types::VOID; +use cretonne_codegen::ir::{AbiParam, ArgumentExtension, ArgumentLoc, CallConv, Ebb, ExtFuncData, + ExternalName, FuncRef, Function, GlobalVar, GlobalVarData, Heap, + HeapBase, HeapData, HeapStyle, JumpTable, JumpTableData, MemFlags, + Opcode, SigRef, Signature, StackSlot, StackSlotData, StackSlotKind, + Type, Value, ValueLoc}; +use cretonne_codegen::isa::{self, Encoding, RegUnit, TargetIsa}; +use cretonne_codegen::packed_option::ReservedValue; +use cretonne_codegen::{settings, timing}; use error::{Error, Location, Result}; use isaspec; use lexer::{self, Lexer, Token}; @@ -2398,10 +2399,10 @@ impl<'a> Parser<'a> { #[cfg(test)] mod tests { use super::*; - use cretonne::ir::StackSlotKind; - use cretonne::ir::entities::AnyEntity; - use cretonne::ir::types; - use cretonne::ir::{ArgumentExtension, ArgumentPurpose, CallConv}; + use cretonne_codegen::ir::StackSlotKind; + use cretonne_codegen::ir::entities::AnyEntity; + use cretonne_codegen::ir::types; + use cretonne_codegen::ir::{ArgumentExtension, ArgumentPurpose, CallConv}; use error::Error; use isaspec::IsaSpec; use testfile::{Comment, Details}; diff --git a/lib/reader/src/sourcemap.rs b/lib/reader/src/sourcemap.rs index b30b172768..a4bc1954c1 100644 --- a/lib/reader/src/sourcemap.rs +++ b/lib/reader/src/sourcemap.rs @@ -6,8 +6,8 @@ //! The `SourceMap` struct defined in this module makes this mapping available //! to parser clients. -use cretonne::ir::entities::AnyEntity; -use cretonne::ir::{Ebb, FuncRef, GlobalVar, Heap, JumpTable, SigRef, StackSlot, Value}; +use cretonne_codegen::ir::entities::AnyEntity; +use cretonne_codegen::ir::{Ebb, FuncRef, GlobalVar, Heap, JumpTable, SigRef, StackSlot, Value}; use error::{Location, Result}; use lexer::split_entity_name; use std::collections::HashMap; diff --git a/lib/reader/src/testfile.rs b/lib/reader/src/testfile.rs index 7218f8cb72..2fae3c2d3d 100644 --- a/lib/reader/src/testfile.rs +++ b/lib/reader/src/testfile.rs @@ -4,8 +4,8 @@ //! file-based test case. //! -use cretonne::ir::Function; -use cretonne::ir::entities::AnyEntity; +use cretonne_codegen::ir::Function; +use cretonne_codegen::ir::entities::AnyEntity; use error::Location; use isaspec::IsaSpec; use sourcemap::SourceMap; diff --git a/lib/wasm/Cargo.toml b/lib/wasm/Cargo.toml index f9c60e7c92..8384df98d7 100644 --- a/lib/wasm/Cargo.toml +++ b/lib/wasm/Cargo.toml @@ -10,7 +10,7 @@ keywords = ["webassembly", "wasm"] [dependencies] wasmparser = "0.15.1" -cretonne = { path = "../cretonne", version = "0.4.4" } +cretonne-codegen = { path = "../codegen", version = "0.4.4" } cretonne-frontend = { path = "../frontend", version = "0.4.4" } [dev-dependencies] diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index 945cedc1de..2b48cd50c0 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -22,10 +22,10 @@ //! //! That is why `translate_function_body` takes an object having the `WasmRuntime` trait as //! argument. -use cretonne::ir::condcodes::{FloatCC, IntCC}; -use cretonne::ir::types::*; -use cretonne::ir::{self, InstBuilder, JumpTableData, MemFlags}; -use cretonne::packed_option::ReservedValue; +use cretonne_codegen::ir::condcodes::{FloatCC, IntCC}; +use cretonne_codegen::ir::types::*; +use cretonne_codegen::ir::{self, InstBuilder, JumpTableData, MemFlags}; +use cretonne_codegen::packed_option::ReservedValue; use cretonne_frontend::{FunctionBuilder, Variable}; use environ::{FuncEnvironment, GlobalValue}; use state::{ControlStackFrame, TranslationState}; diff --git a/lib/wasm/src/environ/dummy.rs b/lib/wasm/src/environ/dummy.rs index 2bac8ed783..598071c325 100644 --- a/lib/wasm/src/environ/dummy.rs +++ b/lib/wasm/src/environ/dummy.rs @@ -1,9 +1,9 @@ //! "Dummy" environment for testing wasm translation. -use cretonne::cursor::FuncCursor; -use cretonne::ir::types::*; -use cretonne::ir::{self, InstBuilder}; -use cretonne::settings; +use cretonne_codegen::cursor::FuncCursor; +use cretonne_codegen::ir::types::*; +use cretonne_codegen::ir::{self, InstBuilder}; +use cretonne_codegen::settings; use environ::{FuncEnvironment, GlobalValue, ModuleEnvironment}; use func_translator::FuncTranslator; use std::error::Error; diff --git a/lib/wasm/src/environ/spec.rs b/lib/wasm/src/environ/spec.rs index 8c313f0ef3..51aba3fd7e 100644 --- a/lib/wasm/src/environ/spec.rs +++ b/lib/wasm/src/environ/spec.rs @@ -1,8 +1,8 @@ //! All the runtime support necessary for the wasm to cretonne translation is formalized by the //! traits `FunctionEnvironment` and `ModuleEnvironment`. -use cretonne::cursor::FuncCursor; -use cretonne::ir::{self, InstBuilder}; -use cretonne::settings::Flags; +use cretonne_codegen::cursor::FuncCursor; +use cretonne_codegen::ir::{self, InstBuilder}; +use cretonne_codegen::settings::Flags; use std::string::String; use std::vec::Vec; use translation_utils::{FunctionIndex, Global, GlobalIndex, Memory, MemoryIndex, SignatureIndex, diff --git a/lib/wasm/src/func_translator.rs b/lib/wasm/src/func_translator.rs index 537aeed0c2..4801cccf11 100644 --- a/lib/wasm/src/func_translator.rs +++ b/lib/wasm/src/func_translator.rs @@ -5,10 +5,10 @@ //! WebAssembly module and the runtime environment. use code_translator::translate_operator; -use cretonne::entity::EntityRef; -use cretonne::ir::{self, Ebb, InstBuilder}; -use cretonne::result::{CtonError, CtonResult}; -use cretonne::timing; +use cretonne_codegen::entity::EntityRef; +use cretonne_codegen::ir::{self, Ebb, InstBuilder}; +use cretonne_codegen::result::{CtonError, CtonResult}; +use cretonne_codegen::timing; use cretonne_frontend::{FunctionBuilder, FunctionBuilderContext, Variable}; use environ::FuncEnvironment; use state::TranslationState; @@ -233,8 +233,8 @@ fn cur_srcloc(reader: &BinaryReader) -> ir::SourceLoc { #[cfg(test)] mod tests { use super::FuncTranslator; - use cretonne::ir::types::I32; - use cretonne::{ir, Context}; + use cretonne_codegen::ir::types::I32; + use cretonne_codegen::{ir, Context}; use environ::{DummyEnvironment, FuncEnvironment}; #[test] diff --git a/lib/wasm/src/lib.rs b/lib/wasm/src/lib.rs index 197d228eab..1f0f063e37 100644 --- a/lib/wasm/src/lib.rs +++ b/lib/wasm/src/lib.rs @@ -14,7 +14,7 @@ #![cfg_attr(feature = "cargo-clippy", allow(new_without_default, redundant_field_names))] #[macro_use(dbg)] -extern crate cretonne; +extern crate cretonne_codegen; extern crate cretonne_frontend; extern crate wasmparser; diff --git a/lib/wasm/src/module_translator.rs b/lib/wasm/src/module_translator.rs index e41712a6d6..f1092651d6 100644 --- a/lib/wasm/src/module_translator.rs +++ b/lib/wasm/src/module_translator.rs @@ -1,6 +1,6 @@ //! Translation skeleton that traverses the whole WebAssembly module and call helper functions //! to deal with each part of it. -use cretonne::timing; +use cretonne_codegen::timing; use environ::ModuleEnvironment; use sections_translator::{parse_data_section, parse_elements_section, parse_export_section, parse_function_section, parse_function_signatures, parse_global_section, @@ -11,7 +11,7 @@ use wasmparser::{BinaryReaderError, Parser, ParserInput, ParserState, SectionCod use std::string::String; /// Translate a sequence of bytes forming a valid Wasm binary into a list of valid Cretonne IR -/// [`Function`](../cretonne/ir/function/struct.Function.html). +/// [`Function`](../codegen/ir/function/struct.Function.html). /// Returns the functions and also the mappings for imported functions and signature between the /// indexes in the wasm module and the indexes inside each functions. pub fn translate_module<'data>( diff --git a/lib/wasm/src/sections_translator.rs b/lib/wasm/src/sections_translator.rs index ce5ed05995..b744c505e4 100644 --- a/lib/wasm/src/sections_translator.rs +++ b/lib/wasm/src/sections_translator.rs @@ -7,8 +7,7 @@ //! The special case of the initialize expressions for table elements offsets or global variables //! is handled, according to the semantics of WebAssembly, to only specific expressions that are //! interpreted on the fly. -use cretonne; -use cretonne::ir::{AbiParam, CallConv, Signature}; +use cretonne_codegen::ir::{self, AbiParam, CallConv, Signature}; use environ::ModuleEnvironment; use std::str::from_utf8; use std::string::String; @@ -38,13 +37,13 @@ pub fn parse_function_signatures( }) => { let mut sig = Signature::new(CallConv::SystemV); sig.params.extend(params.iter().map(|ty| { - let cret_arg: cretonne::ir::Type = type_to_type(ty).expect( + let cret_arg: ir::Type = type_to_type(ty).expect( "only numeric types are supported in function signatures", ); AbiParam::new(cret_arg) })); sig.returns.extend(returns.iter().map(|ty| { - let cret_arg: cretonne::ir::Type = type_to_type(ty).expect( + let cret_arg: ir::Type = type_to_type(ty).expect( "only numeric types are supported in function signatures", ); AbiParam::new(cret_arg) diff --git a/lib/wasm/src/state.rs b/lib/wasm/src/state.rs index f95619d52b..c322906c95 100644 --- a/lib/wasm/src/state.rs +++ b/lib/wasm/src/state.rs @@ -3,7 +3,7 @@ //! The `TranslationState` struct defined in this module is used to keep track of the WebAssembly //! value and control stacks during the translation of a single function. -use cretonne::ir::{self, Ebb, Inst, Value}; +use cretonne_codegen::ir::{self, Ebb, Inst, Value}; use environ::{FuncEnvironment, GlobalValue}; use std::collections::HashMap; use std::vec::Vec; diff --git a/lib/wasm/src/translation_utils.rs b/lib/wasm/src/translation_utils.rs index bac50be7a6..0089c5a75d 100644 --- a/lib/wasm/src/translation_utils.rs +++ b/lib/wasm/src/translation_utils.rs @@ -1,5 +1,5 @@ //! Helper functions and structures for the translation. -use cretonne; +use cretonne_codegen::ir; use std::u32; use wasmparser; @@ -18,7 +18,7 @@ pub type SignatureIndex = usize; #[derive(Debug, Clone, Copy)] pub struct Global { /// The type of the value stored in the global. - pub ty: cretonne::ir::Type, + pub ty: ir::Type, /// A flag indicating whether the value may change at runtime. pub mutability: bool, /// The source of the initial value. @@ -56,7 +56,7 @@ pub struct Table { /// WebAssembly table element. Can be a function or a scalar type. #[derive(Debug, Clone, Copy)] pub enum TableElementType { - Val(cretonne::ir::Type), + Val(ir::Type), Func(), } @@ -72,24 +72,24 @@ pub struct Memory { } /// Helper function translating wasmparser types to Cretonne types when possible. -pub fn type_to_type(ty: &wasmparser::Type) -> Result { +pub fn type_to_type(ty: &wasmparser::Type) -> Result { match *ty { - wasmparser::Type::I32 => Ok(cretonne::ir::types::I32), - wasmparser::Type::I64 => Ok(cretonne::ir::types::I64), - wasmparser::Type::F32 => Ok(cretonne::ir::types::F32), - wasmparser::Type::F64 => Ok(cretonne::ir::types::F64), + wasmparser::Type::I32 => Ok(ir::types::I32), + wasmparser::Type::I64 => Ok(ir::types::I64), + wasmparser::Type::F32 => Ok(ir::types::F32), + wasmparser::Type::F64 => Ok(ir::types::F64), _ => Err(()), } } /// Turns a `wasmparser` `f32` into a `Cretonne` one. -pub fn f32_translation(x: wasmparser::Ieee32) -> cretonne::ir::immediates::Ieee32 { - cretonne::ir::immediates::Ieee32::with_bits(x.bits()) +pub fn f32_translation(x: wasmparser::Ieee32) -> ir::immediates::Ieee32 { + ir::immediates::Ieee32::with_bits(x.bits()) } /// Turns a `wasmparser` `f64` into a `Cretonne` one. -pub fn f64_translation(x: wasmparser::Ieee64) -> cretonne::ir::immediates::Ieee64 { - cretonne::ir::immediates::Ieee64::with_bits(x.bits()) +pub fn f64_translation(x: wasmparser::Ieee64) -> ir::immediates::Ieee64 { + ir::immediates::Ieee64::with_bits(x.bits()) } /// Translate a `wasmparser` type into its `Cretonne` equivalent, when possible diff --git a/lib/wasm/tests/wasm_testsuite.rs b/lib/wasm/tests/wasm_testsuite.rs index fac93e6012..15feea4b55 100644 --- a/lib/wasm/tests/wasm_testsuite.rs +++ b/lib/wasm/tests/wasm_testsuite.rs @@ -1,10 +1,10 @@ -extern crate cretonne; +extern crate cretonne_codegen; extern crate cretonne_wasm; extern crate tempdir; -use cretonne::print_errors::pretty_verifier_error; -use cretonne::settings::{self, Configurable, Flags}; -use cretonne::verifier; +use cretonne_codegen::print_errors::pretty_verifier_error; +use cretonne_codegen::settings::{self, Configurable, Flags}; +use cretonne_codegen::verifier; use cretonne_wasm::{translate_module, DummyEnvironment}; use std::error::Error; use std::fs;