From e7f30a40b4f539b800ba32cc57fe834e57702a2f Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Mon, 17 Oct 2016 14:16:43 -0700 Subject: [PATCH] Move the 'meta' dir to 'lib/cretonne/meta'. The 'lib/cretonne' directory will be the new root of a stand-alone cretonne crate containg both Python and Rust sources. This is in preparation for publishing crates on crates.io. --- docs/Makefile | 2 +- docs/conf.py | 2 +- docs/metaref.rst | 16 +++++++++------- {meta => lib/cretonne/meta}/build.py | 0 {meta => lib/cretonne/meta}/check.sh | 0 {meta => lib/cretonne/meta}/constant_hash.py | 0 {meta => lib/cretonne/meta}/cretonne/__init__.py | 0 {meta => lib/cretonne/meta}/cretonne/ast.py | 0 {meta => lib/cretonne/meta}/cretonne/base.py | 0 {meta => lib/cretonne/meta}/cretonne/entities.py | 0 {meta => lib/cretonne/meta}/cretonne/formats.py | 0 .../cretonne/meta}/cretonne/immediates.py | 0 {meta => lib/cretonne/meta}/cretonne/legalize.py | 0 .../cretonne/meta}/cretonne/predicates.py | 0 {meta => lib/cretonne/meta}/cretonne/settings.py | 0 {meta => lib/cretonne/meta}/cretonne/test_ast.py | 0 .../cretonne/meta}/cretonne/test_typevar.py | 0 .../cretonne/meta}/cretonne/test_xform.py | 0 {meta => lib/cretonne/meta}/cretonne/types.py | 0 {meta => lib/cretonne/meta}/cretonne/typevar.py | 0 {meta => lib/cretonne/meta}/cretonne/xform.py | 0 {meta => lib/cretonne/meta}/gen_build_deps.py | 0 {meta => lib/cretonne/meta}/gen_encoding.py | 0 {meta => lib/cretonne/meta}/gen_instr.py | 0 {meta => lib/cretonne/meta}/gen_settings.py | 0 {meta => lib/cretonne/meta}/gen_types.py | 0 {meta => lib/cretonne/meta}/isa/__init__.py | 0 .../cretonne/meta}/isa/riscv/__init__.py | 0 {meta => lib/cretonne/meta}/isa/riscv/defs.py | 0 .../cretonne/meta}/isa/riscv/encodings.py | 0 {meta => lib/cretonne/meta}/isa/riscv/recipes.py | 0 .../cretonne/meta}/isa/riscv/settings.py | 0 {meta => lib/cretonne/meta}/srcgen.py | 0 .../cretonne/meta}/test_constant_hash.py | 0 {meta => lib/cretonne/meta}/test_srcgen.py | 0 {meta => lib/cretonne/meta}/unique_table.py | 0 src/libcretonne/build.rs | 2 +- 37 files changed, 12 insertions(+), 10 deletions(-) rename {meta => lib/cretonne/meta}/build.py (100%) rename {meta => lib/cretonne/meta}/check.sh (100%) rename {meta => lib/cretonne/meta}/constant_hash.py (100%) rename {meta => lib/cretonne/meta}/cretonne/__init__.py (100%) rename {meta => lib/cretonne/meta}/cretonne/ast.py (100%) rename {meta => lib/cretonne/meta}/cretonne/base.py (100%) rename {meta => lib/cretonne/meta}/cretonne/entities.py (100%) rename {meta => lib/cretonne/meta}/cretonne/formats.py (100%) rename {meta => lib/cretonne/meta}/cretonne/immediates.py (100%) rename {meta => lib/cretonne/meta}/cretonne/legalize.py (100%) rename {meta => lib/cretonne/meta}/cretonne/predicates.py (100%) rename {meta => lib/cretonne/meta}/cretonne/settings.py (100%) rename {meta => lib/cretonne/meta}/cretonne/test_ast.py (100%) rename {meta => lib/cretonne/meta}/cretonne/test_typevar.py (100%) rename {meta => lib/cretonne/meta}/cretonne/test_xform.py (100%) rename {meta => lib/cretonne/meta}/cretonne/types.py (100%) rename {meta => lib/cretonne/meta}/cretonne/typevar.py (100%) rename {meta => lib/cretonne/meta}/cretonne/xform.py (100%) rename {meta => lib/cretonne/meta}/gen_build_deps.py (100%) rename {meta => lib/cretonne/meta}/gen_encoding.py (100%) rename {meta => lib/cretonne/meta}/gen_instr.py (100%) rename {meta => lib/cretonne/meta}/gen_settings.py (100%) rename {meta => lib/cretonne/meta}/gen_types.py (100%) rename {meta => lib/cretonne/meta}/isa/__init__.py (100%) rename {meta => lib/cretonne/meta}/isa/riscv/__init__.py (100%) rename {meta => lib/cretonne/meta}/isa/riscv/defs.py (100%) rename {meta => lib/cretonne/meta}/isa/riscv/encodings.py (100%) rename {meta => lib/cretonne/meta}/isa/riscv/recipes.py (100%) rename {meta => lib/cretonne/meta}/isa/riscv/settings.py (100%) rename {meta => lib/cretonne/meta}/srcgen.py (100%) rename {meta => lib/cretonne/meta}/test_constant_hash.py (100%) rename {meta => lib/cretonne/meta}/test_srcgen.py (100%) rename {meta => lib/cretonne/meta}/unique_table.py (100%) diff --git a/docs/Makefile b/docs/Makefile index 56137e8b2c..b2443f68b7 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -58,7 +58,7 @@ html: @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." autohtml: html - $(SPHINXABUILD) -z ../meta --ignore '*.swp' -b html -E $(ALLSPHINXOPTS) $(BUILDDIR)/html + $(SPHINXABUILD) -z ../lib/cretonne/meta --ignore '*.swp' -b html -E $(ALLSPHINXOPTS) $(BUILDDIR)/html dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml diff --git a/docs/conf.py b/docs/conf.py index 5602561828..0603a27bfd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,7 +24,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('../meta')) +sys.path.insert(0, os.path.abspath('../lib/cretonne/meta')) # -- General configuration ------------------------------------------------ diff --git a/docs/metaref.rst b/docs/metaref.rst index 4edf708041..cc6d7173d6 100644 --- a/docs/metaref.rst +++ b/docs/metaref.rst @@ -10,8 +10,9 @@ The Cretonne meta language is used to define instructions for Cretonne. It is a 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:`meta` -top-level directory. The descriptions are processed in two steps: +The meta language descriptions are Python modules under the +:file:`lib/cretonne/meta` directory. The descriptions are processed in two +steps: 1. The Python modules are imported. This has the effect of building static data structures in global variables in the modules. These static data structures @@ -22,8 +23,9 @@ top-level directory. The descriptions are processed in two steps: constant tables. The main driver for this source code generation process is the -:file:`meta/build.py` script which is invoked as part of the build process if -anything in the :file:`meta` directory has changed since the last build. +: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 +since the last build. Settings @@ -33,8 +35,8 @@ Settings are used by the environment embedding Cretonne to control the details 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:`cretonne.settings` module. Some settings are specific to a target -ISA, and defined in a `settings` module under the appropriate :file:`meta/isa/*` -directory. +ISA, and defined in a `settings` module under the appropriate +:file:`lib/cretonne/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`: @@ -343,7 +345,7 @@ architectures. Each ISA is represented by a :py:class:`cretonne.TargetISA` insta .. autoclass:: TargetISA The definitions for each supported target live in a package under -:file:`meta/isa`. +:file:`lib/cretonne/meta/isa`. .. automodule:: isa :members: diff --git a/meta/build.py b/lib/cretonne/meta/build.py similarity index 100% rename from meta/build.py rename to lib/cretonne/meta/build.py diff --git a/meta/check.sh b/lib/cretonne/meta/check.sh similarity index 100% rename from meta/check.sh rename to lib/cretonne/meta/check.sh diff --git a/meta/constant_hash.py b/lib/cretonne/meta/constant_hash.py similarity index 100% rename from meta/constant_hash.py rename to lib/cretonne/meta/constant_hash.py diff --git a/meta/cretonne/__init__.py b/lib/cretonne/meta/cretonne/__init__.py similarity index 100% rename from meta/cretonne/__init__.py rename to lib/cretonne/meta/cretonne/__init__.py diff --git a/meta/cretonne/ast.py b/lib/cretonne/meta/cretonne/ast.py similarity index 100% rename from meta/cretonne/ast.py rename to lib/cretonne/meta/cretonne/ast.py diff --git a/meta/cretonne/base.py b/lib/cretonne/meta/cretonne/base.py similarity index 100% rename from meta/cretonne/base.py rename to lib/cretonne/meta/cretonne/base.py diff --git a/meta/cretonne/entities.py b/lib/cretonne/meta/cretonne/entities.py similarity index 100% rename from meta/cretonne/entities.py rename to lib/cretonne/meta/cretonne/entities.py diff --git a/meta/cretonne/formats.py b/lib/cretonne/meta/cretonne/formats.py similarity index 100% rename from meta/cretonne/formats.py rename to lib/cretonne/meta/cretonne/formats.py diff --git a/meta/cretonne/immediates.py b/lib/cretonne/meta/cretonne/immediates.py similarity index 100% rename from meta/cretonne/immediates.py rename to lib/cretonne/meta/cretonne/immediates.py diff --git a/meta/cretonne/legalize.py b/lib/cretonne/meta/cretonne/legalize.py similarity index 100% rename from meta/cretonne/legalize.py rename to lib/cretonne/meta/cretonne/legalize.py diff --git a/meta/cretonne/predicates.py b/lib/cretonne/meta/cretonne/predicates.py similarity index 100% rename from meta/cretonne/predicates.py rename to lib/cretonne/meta/cretonne/predicates.py diff --git a/meta/cretonne/settings.py b/lib/cretonne/meta/cretonne/settings.py similarity index 100% rename from meta/cretonne/settings.py rename to lib/cretonne/meta/cretonne/settings.py diff --git a/meta/cretonne/test_ast.py b/lib/cretonne/meta/cretonne/test_ast.py similarity index 100% rename from meta/cretonne/test_ast.py rename to lib/cretonne/meta/cretonne/test_ast.py diff --git a/meta/cretonne/test_typevar.py b/lib/cretonne/meta/cretonne/test_typevar.py similarity index 100% rename from meta/cretonne/test_typevar.py rename to lib/cretonne/meta/cretonne/test_typevar.py diff --git a/meta/cretonne/test_xform.py b/lib/cretonne/meta/cretonne/test_xform.py similarity index 100% rename from meta/cretonne/test_xform.py rename to lib/cretonne/meta/cretonne/test_xform.py diff --git a/meta/cretonne/types.py b/lib/cretonne/meta/cretonne/types.py similarity index 100% rename from meta/cretonne/types.py rename to lib/cretonne/meta/cretonne/types.py diff --git a/meta/cretonne/typevar.py b/lib/cretonne/meta/cretonne/typevar.py similarity index 100% rename from meta/cretonne/typevar.py rename to lib/cretonne/meta/cretonne/typevar.py diff --git a/meta/cretonne/xform.py b/lib/cretonne/meta/cretonne/xform.py similarity index 100% rename from meta/cretonne/xform.py rename to lib/cretonne/meta/cretonne/xform.py diff --git a/meta/gen_build_deps.py b/lib/cretonne/meta/gen_build_deps.py similarity index 100% rename from meta/gen_build_deps.py rename to lib/cretonne/meta/gen_build_deps.py diff --git a/meta/gen_encoding.py b/lib/cretonne/meta/gen_encoding.py similarity index 100% rename from meta/gen_encoding.py rename to lib/cretonne/meta/gen_encoding.py diff --git a/meta/gen_instr.py b/lib/cretonne/meta/gen_instr.py similarity index 100% rename from meta/gen_instr.py rename to lib/cretonne/meta/gen_instr.py diff --git a/meta/gen_settings.py b/lib/cretonne/meta/gen_settings.py similarity index 100% rename from meta/gen_settings.py rename to lib/cretonne/meta/gen_settings.py diff --git a/meta/gen_types.py b/lib/cretonne/meta/gen_types.py similarity index 100% rename from meta/gen_types.py rename to lib/cretonne/meta/gen_types.py diff --git a/meta/isa/__init__.py b/lib/cretonne/meta/isa/__init__.py similarity index 100% rename from meta/isa/__init__.py rename to lib/cretonne/meta/isa/__init__.py diff --git a/meta/isa/riscv/__init__.py b/lib/cretonne/meta/isa/riscv/__init__.py similarity index 100% rename from meta/isa/riscv/__init__.py rename to lib/cretonne/meta/isa/riscv/__init__.py diff --git a/meta/isa/riscv/defs.py b/lib/cretonne/meta/isa/riscv/defs.py similarity index 100% rename from meta/isa/riscv/defs.py rename to lib/cretonne/meta/isa/riscv/defs.py diff --git a/meta/isa/riscv/encodings.py b/lib/cretonne/meta/isa/riscv/encodings.py similarity index 100% rename from meta/isa/riscv/encodings.py rename to lib/cretonne/meta/isa/riscv/encodings.py diff --git a/meta/isa/riscv/recipes.py b/lib/cretonne/meta/isa/riscv/recipes.py similarity index 100% rename from meta/isa/riscv/recipes.py rename to lib/cretonne/meta/isa/riscv/recipes.py diff --git a/meta/isa/riscv/settings.py b/lib/cretonne/meta/isa/riscv/settings.py similarity index 100% rename from meta/isa/riscv/settings.py rename to lib/cretonne/meta/isa/riscv/settings.py diff --git a/meta/srcgen.py b/lib/cretonne/meta/srcgen.py similarity index 100% rename from meta/srcgen.py rename to lib/cretonne/meta/srcgen.py diff --git a/meta/test_constant_hash.py b/lib/cretonne/meta/test_constant_hash.py similarity index 100% rename from meta/test_constant_hash.py rename to lib/cretonne/meta/test_constant_hash.py diff --git a/meta/test_srcgen.py b/lib/cretonne/meta/test_srcgen.py similarity index 100% rename from meta/test_srcgen.py rename to lib/cretonne/meta/test_srcgen.py diff --git a/meta/unique_table.py b/lib/cretonne/meta/unique_table.py similarity index 100% rename from meta/unique_table.py rename to lib/cretonne/meta/unique_table.py diff --git a/src/libcretonne/build.rs b/src/libcretonne/build.rs index c275e33e53..2cb13ac959 100644 --- a/src/libcretonne/build.rs +++ b/src/libcretonne/build.rs @@ -29,7 +29,7 @@ fn main() { let top_dir = cur_dir.as_path(); // Scripts are in $top_dir/meta. - let meta_dir = top_dir.join("meta"); + let meta_dir = top_dir.join("lib/cretonne/meta"); let build_script = meta_dir.join("build.py"); // Launch build script with Python. We'll just find python in the path.