diff --git a/README.rst b/README.rst index 12b889f56d..41e6a9284d 100644 --- a/README.rst +++ b/README.rst @@ -3,7 +3,7 @@ Cretonne Code Generator ======================= Cretonne is a low-level retargetable code generator. It translates a `target-independent -intermediate language `_ into executable +intermediate representation `_ into executable machine code. *This is a work in progress that is not yet functional.* diff --git a/cranelift/docs/compare-llvm.rst b/cranelift/docs/compare-llvm.rst index 0180f6cc92..4a622dbeda 100644 --- a/cranelift/docs/compare-llvm.rst +++ b/cranelift/docs/compare-llvm.rst @@ -16,8 +16,8 @@ highlighting some of the differences and similarities. Both projects: - Use an ISA-agnostic input language in order to mostly abstract away the differences between target instruction set architectures. - Depend extensively on SSA form. -- Have both textual and in-memory forms of their primary intermediate language. - (LLVM also has a binary bitcode format; Cretonne doesn't.) +- Have both textual and in-memory forms of their primary intermediate + representation. (LLVM also has a binary bitcode format; Cretonne doesn't.) - Can target multiple ISAs. - Can cross-compile by default without rebuilding the code generator. @@ -41,8 +41,8 @@ LLVM uses multiple intermediate representations as it translates a program to binary machine code: `LLVM IR `_ - This is the primary intermediate language which has textual, binary, and - in-memory representations. It serves two main purposes: + This is the primary intermediate representation which has textual, binary, and + in-memory forms. It serves two main purposes: - An ISA-agnostic, stable(ish) input language that front ends can generate easily. @@ -89,9 +89,9 @@ representation. Some target ISAs have a fast instruction selector that can translate simple code directly to MachineInstrs, bypassing SelectionDAG when possible. -:doc:`Cretonne ` uses a single intermediate language to cover these -levels of abstraction. This is possible in part because of Cretonne's smaller -scope. +:doc:`Cretonne ` uses a single intermediate representation to cover +these levels of abstraction. This is possible in part because of Cretonne's +smaller scope. - Cretonne does not provide assemblers and disassemblers, so it is not necessary to be able to represent every weird instruction in an ISA. Only @@ -102,7 +102,7 @@ scope. - SSA form is preserved throughout. After register allocation, each SSA value is annotated with an assigned ISA register or stack slot. -The Cretonne intermediate language is similar to LLVM IR, but at a slightly +The Cretonne intermediate representation is similar to LLVM IR, but at a slightly lower level of abstraction. Program structure @@ -112,12 +112,12 @@ In LLVM IR, the largest representable unit is the *module* which corresponds more or less to a C translation unit. It is a collection of functions and global variables that may contain references to external symbols too. -In Cretonne IL, the largest representable unit is the *function*. This is so +In Cretonne IR, the largest representable unit is the *function*. This is so that functions can easily be compiled in parallel without worrying about references to shared data structures. Cretonne does not have any inter-procedural optimizations like inlining. -An LLVM IR function is a graph of *basic blocks*. A Cretonne IL function is a +An LLVM IR function is a graph of *basic blocks*. A Cretonne IR function is a graph of *extended basic blocks* that may contain internal branch instructions. The main difference is that an LLVM conditional branch instruction has two target basic blocks---a true and a false edge. A Cretonne branch instruction diff --git a/cranelift/docs/cton_domain.py b/cranelift/docs/cton_domain.py index a03acf1160..2d6e45eeed 100644 --- a/cranelift/docs/cton_domain.py +++ b/cranelift/docs/cton_domain.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Sphinx domain for documenting compiler intermediate languages. +# Sphinx domain for documenting compiler intermediate representations. # # This defines a 'cton' Sphinx domain with the following directives and roles: # @@ -29,10 +29,10 @@ import sphinx.ext.autodoc class CtonObject(ObjectDescription): """ - Any kind of Cretonne IL object. + Any kind of Cretonne IR object. This is a shared base class for the different kinds of indexable objects - in the Cretonne IL reference. + in the Cretonne IR reference. """ option_spec = { 'noindex': directives.flag, @@ -98,7 +98,7 @@ def parse_type(name, signode): class CtonType(CtonObject): - """A Cretonne IL type description.""" + """A Cretonne IR type description.""" def handle_signature(self, sig, signode): """ @@ -112,7 +112,7 @@ class CtonType(CtonObject): return name def get_index_text(self, name): - return name + ' (IL type)' + return name + ' (IR type)' sep_equal = re.compile('\s*=\s*') @@ -127,7 +127,7 @@ def parse_params(s, signode): class CtonInst(CtonObject): - """A Cretonne IL instruction.""" + """A Cretonne IR instruction.""" doc_field_types = [ TypedField('argument', label=l_('Arguments'), @@ -176,11 +176,11 @@ class CtonInst(CtonObject): class CtonInstGroup(CtonObject): - """A Cretonne IL instruction group.""" + """A Cretonne IR instruction group.""" class CretonneDomain(Domain): - """Cretonne domain for intermediate language objects.""" + """Cretonne domain for IR objects.""" name = 'cton' label = 'Cretonne' diff --git a/cranelift/docs/langref.rst b/cranelift/docs/langref.rst index fb716257bd..162248c83e 100644 --- a/cranelift/docs/langref.rst +++ b/cranelift/docs/langref.rst @@ -5,19 +5,19 @@ Cretonne Language Reference .. default-domain:: cton .. highlight:: cton -The Cretonne intermediate language (:term:`IL`) has two equivalent -representations: an *in-memory data structure* that the code generator library -is using, and a *text format* which is used for test cases and debug output. -Files containing Cretonne textual IL have the ``.cton`` filename extension. +The Cretonne intermediate representation (:term:`IR`) has two primary forms: +an *in-memory data structure* that the code generator library is using, and a +*text format* which is used for test cases and debug output. +Files containing Cretonne textual IR have the ``.cton`` filename extension. -This reference uses the text format to describe IL semantics but glosses over +This reference uses the text format to describe IR semantics but glosses over the finer details of the lexical and syntactic structure of the format. Overall structure ================= -Cretonne compiles functions independently. A ``.cton`` IL file may contain +Cretonne compiles functions independently. A ``.cton`` IR file may contain multiple functions, and the programmatic API can create multiple function handles at the same time, but the functions don't share any data or reference each other directly. @@ -27,7 +27,7 @@ This is a simple C function that computes the average of an array of floats: .. literalinclude:: example.c :language: c -Here is the same function compiled into Cretonne IL: +Here is the same function compiled into Cretonne IR: .. literalinclude:: example.cton :language: cton @@ -77,7 +77,7 @@ variable value for the next iteration. The `cton_frontend` crate contains utilities for translating from programs containing multiple assignments to the same variables into SSA form for -Cretonne :term:`IL`. +Cretonne :term:`IR`. Such variables can also be presented to Cretonne as :term:`stack slot`\s. Stack slots are accessed with the :inst:`stack_store` and :inst:`stack_load` @@ -303,7 +303,7 @@ indicate the different kinds of immediate operands on an instruction. A floating point condition code. See the :inst:`fcmp` instruction for details. The two IEEE floating point immediate types :type:`ieee32` and :type:`ieee64` -are displayed as hexadecimal floating point literals in the textual :term:`IL` +are displayed as hexadecimal floating point literals in the textual :term:`IR` format. Decimal floating point literals are not allowed because some computer systems can round differently when converting to binary. The hexadecimal floating point format is mostly the same as the one used by C99, but extended @@ -563,7 +563,7 @@ runtime data structures. alignment for storing a pointer. Chains of ``deref`` global variables are possible, but cycles are not - allowed. They will be caught by the IL verifier. + allowed. They will be caught by the IR verifier. :arg BaseGV: Global variable containing the base pointer. :arg Offset: Byte offset from the loaded base pointer to the global @@ -1154,19 +1154,11 @@ Glossary The extended basic blocks which contain all the executable code in a function. The function body follows the function preamble. - intermediate language - IL - The language used to describe functions to Cretonne. This reference - describes the syntax and semantics of the Cretonne IL. The IL has two - forms: Textual and an in-memory intermediate representation - (:term:`IR`). - intermediate representation IR - The in-memory representation of :term:`IL`. The data structures - Cretonne uses to represent a program internally are called the - intermediate representation. Cretonne's IR can be converted to text - losslessly. + The language used to describe functions to Cretonne. This reference + describes the syntax and semantics of Cretonne IR. The IR has two + forms: Textual, and an in-memory data structure. stack slot A fixed size memory allocation in the current function's activation diff --git a/cranelift/docs/testing.rst b/cranelift/docs/testing.rst index 320cc37389..c14a74aeba 100644 --- a/cranelift/docs/testing.rst +++ b/cranelift/docs/testing.rst @@ -89,7 +89,7 @@ easier to provide substantial input functions for the compiler tests. File tests are :file:`*.cton` files in the :file:`filetests/` directory hierarchy. Each file has a header describing what to test followed by a number -of input functions in the :doc:`Cretonne textual intermediate language +of input functions in the :doc:`Cretonne textual intermediate representation `: .. productionlist:: @@ -166,7 +166,7 @@ Cretonne's tests don't need this. ---------- This is one of the simplest file tests, used for testing the conversion to and -from textual IL. The ``test cat`` command simply parses each function and +from textual IR. The ``test cat`` command simply parses each function and converts it back to text again. The text of each function is then matched against the associated filecheck directives. @@ -188,7 +188,7 @@ Example:: `test verifier` --------------- -Run each function through the IL verifier and check that it produces the +Run each function through the IR verifier and check that it produces the expected error messages. Expected error messages are indicated with an ``error:`` directive *on the @@ -351,4 +351,4 @@ Each function is passed through the full ``Context::compile()`` function which is normally used to compile code. This type of test often depends on assertions or verifier errors, but it is also possible to use filecheck directives which will be matched against the final form of the -Cretonne IL right before binary machine code emission. +Cretonne IR right before binary machine code emission. diff --git a/cranelift/src/cat.rs b/cranelift/src/cat.rs index 4d3d73ac2c..0fc5541db9 100644 --- a/cranelift/src/cat.rs +++ b/cranelift/src/cat.rs @@ -1,6 +1,6 @@ //! The `cat` sub-command. //! -//! Read a sequence of Cretonne IL files and print them again to stdout. This has the effect of +//! Read a sequence of Cretonne IR files and print them again to stdout. This has the effect of //! normalizing formatting and removing comments. use cton_reader::parse_functions; diff --git a/cranelift/src/compile.rs b/cranelift/src/compile.rs index a1cc244f5d..c21b989149 100644 --- a/cranelift/src/compile.rs +++ b/cranelift/src/compile.rs @@ -1,6 +1,4 @@ -//! CLI tool to compile cretonne IL into native code. -//! -//! Reads IR files into Cretonne IL and compiles it. +//! CLI tool to read Cretonne IR files and compile them into native code. use cton_reader::parse_test; use std::path::PathBuf; diff --git a/cranelift/src/cton-util.rs b/cranelift/src/cton-util.rs index 216eae458b..4dd9865d3d 100644 --- a/cranelift/src/cton-util.rs +++ b/cranelift/src/cton-util.rs @@ -38,12 +38,12 @@ Options: -T, --time-passes print pass timing report -t, --just-decode - just decode WebAssembly to Cretonne IL + just decode WebAssembly to Cretonne IR -s, --print-size prints generated code size -c, --check-translation - just checks the correctness of Cretonne IL translated from WebAssembly - -p, --print print the resulting Cretonne IL + just checks the correctness of Cretonne IR translated from WebAssembly + -p, --print print the resulting Cretonne IR -h, --help print this help message --set= configure Cretonne settings --isa= specify the Cretonne ISA diff --git a/cranelift/src/print_cfg.rs b/cranelift/src/print_cfg.rs index 65242cc8f8..846ee3e8fa 100644 --- a/cranelift/src/print_cfg.rs +++ b/cranelift/src/print_cfg.rs @@ -1,6 +1,6 @@ //! The `print-cfg` sub-command. //! -//! Read a series of Cretonne IL files and print their control flow graphs +//! Read a series of Cretonne IR files and print their control flow graphs //! in graphviz format. use CommandResult; diff --git a/cranelift/src/wasm.rs b/cranelift/src/wasm.rs index 5f986ee5f2..918deffd5a 100644 --- a/cranelift/src/wasm.rs +++ b/cranelift/src/wasm.rs @@ -1,6 +1,6 @@ //! CLI tool to use the functions provided by the [cretonne-wasm](../cton_wasm/index.html) crate. //! -//! Reads Wasm binary files, translates the functions' code to Cretonne IL. +//! Reads Wasm binary files, translates the functions' code to Cretonne IR. #![cfg_attr(feature = "cargo-clippy", allow(too_many_arguments, cyclomatic_complexity))] use cton_wasm::{translate_module, DummyEnvironment, ModuleEnvironment}; diff --git a/lib/cretonne/README.md b/lib/cretonne/README.md index 73b2806f5d..c12dfbf5a9 100644 --- a/lib/cretonne/README.md +++ b/lib/cretonne/README.md @@ -1,2 +1,2 @@ This crate contains the core Cretonne code generator. It translates code from an -intermediate language into executable machine code. +intermediate representation into executable machine code. diff --git a/lib/cretonne/meta/base/formats.py b/lib/cretonne/meta/base/formats.py index b50824581b..595f09b9fa 100644 --- a/lib/cretonne/meta/base/formats.py +++ b/lib/cretonne/meta/base/formats.py @@ -2,7 +2,7 @@ The cretonne.formats defines all instruction formats. Every instruction format has a corresponding `InstructionData` variant in the -Rust representation of cretonne IL, so all instruction formats must be defined +Rust representation of Cretonne IR, so all instruction formats must be defined in this module. """ from __future__ import absolute_import diff --git a/lib/cretonne/meta/base/settings.py b/lib/cretonne/meta/base/settings.py index e8785fbc08..3bd90f107b 100644 --- a/lib/cretonne/meta/base/settings.py +++ b/lib/cretonne/meta/base/settings.py @@ -20,10 +20,10 @@ opt_level = EnumSetting( enable_verifier = BoolSetting( """ - Run the Cretonne IL verifier at strategic times during compilation. + Run the Cretonne IR verifier at strategic times during compilation. This makes compilation slower but catches many bugs. The verifier is - disabled by default, except when reading Cretonne IL from a text file. + disabled by default, except when reading Cretonne IR from a text file. """, default=True) diff --git a/lib/cretonne/meta/cdsl/ast.py b/lib/cretonne/meta/cdsl/ast.py index 38d633e17d..5eefe222f8 100644 --- a/lib/cretonne/meta/cdsl/ast.py +++ b/lib/cretonne/meta/cdsl/ast.py @@ -559,7 +559,7 @@ class Enumerator(Literal): is an AST leaf node representing one of the values. :param kind: The enumerated `ImmediateKind` containing the value. - :param value: The textual IL representation of the value. + :param value: The textual IR representation of the value. `Enumerator` nodes are not usually created directly. They are created by using the dot syntax on immediate kinds: `intcc.ult`. diff --git a/lib/cretonne/src/binemit/memorysink.rs b/lib/cretonne/src/binemit/memorysink.rs index 1d6758afe6..506ea8b5a4 100644 --- a/lib/cretonne/src/binemit/memorysink.rs +++ b/lib/cretonne/src/binemit/memorysink.rs @@ -20,7 +20,7 @@ use std::ptr::write_unaligned; /// A `CodeSink` that writes binary machine code directly into memory. /// -/// A `MemoryCodeSink` object should be used when emitting a Cretonne IL function into executable +/// A `MemoryCodeSink` object should be used when emitting a Cretonne IR function into executable /// memory. It writes machine code directly to a raw pointer without any bounds checking, so make /// sure to allocate enough memory for the whole function. The number of bytes required is returned /// by the `Context::compile()` function. diff --git a/lib/cretonne/src/ir/entities.rs b/lib/cretonne/src/ir/entities.rs index 1a4e772be4..0727721d6a 100644 --- a/lib/cretonne/src/ir/entities.rs +++ b/lib/cretonne/src/ir/entities.rs @@ -1,6 +1,6 @@ -//! IL entity references. +//! Cretonne IR entity references. //! -//! Instructions in Cretonne IL need to reference other entities in the function. This can be other +//! Instructions in Cretonne IR need to reference other entities in the function. This can be other //! parts of the function like extended basic blocks or stack slots, or it can be external entities //! that are declared in the function preamble in the text format. //! @@ -16,7 +16,7 @@ //! data structures use the `PackedOption` representation, while function arguments and //! return values prefer the more Rust-like `Option` variant. //! -//! The entity references all implement the `Display` trait in a way that matches the textual IL +//! The entity references all implement the `Display` trait in a way that matches the textual IR //! format. use std::fmt; diff --git a/lib/cretonne/src/ir/function.rs b/lib/cretonne/src/ir/function.rs index 8ee332526f..e52bb4c96f 100644 --- a/lib/cretonne/src/ir/function.rs +++ b/lib/cretonne/src/ir/function.rs @@ -55,7 +55,7 @@ pub struct Function { /// /// This information is only transiently available after the `binemit::relax_branches` function /// computes it, and it can easily be recomputed by calling that function. It is not included - /// in the textual IL format. + /// in the textual IR format. pub offsets: EbbOffsets, /// Source locations. diff --git a/lib/cretonne/src/ir/instructions.rs b/lib/cretonne/src/ir/instructions.rs index 68ee656e85..bb09e24834 100644 --- a/lib/cretonne/src/ir/instructions.rs +++ b/lib/cretonne/src/ir/instructions.rs @@ -1,7 +1,7 @@ //! Instruction formats and opcodes. //! //! The `instructions` module contains definitions for instruction formats, opcodes, and the -//! in-memory representation of IL instructions. +//! in-memory representation of IR instructions. //! //! A large part of this module is auto-generated from the instruction descriptions in the meta //! directory. diff --git a/lib/cretonne/src/ir/layout.rs b/lib/cretonne/src/ir/layout.rs index 2f4c378edd..c19cf6dd37 100644 --- a/lib/cretonne/src/ir/layout.rs +++ b/lib/cretonne/src/ir/layout.rs @@ -71,8 +71,7 @@ impl Layout { // within an EBB. The instruction sequence numbers are all between the sequence number of their // containing EBB and the following EBB. // -// The result is that sequence numbers work like BASIC line numbers for the textual representation -// of the IL. +// The result is that sequence numbers work like BASIC line numbers for the textual form of the IR. type SequenceNumber = u32; // Initial stride assigned to new sequence numbers. diff --git a/lib/cretonne/src/ir/libcall.rs b/lib/cretonne/src/ir/libcall.rs index 85133611be..6434197247 100644 --- a/lib/cretonne/src/ir/libcall.rs +++ b/lib/cretonne/src/ir/libcall.rs @@ -6,7 +6,7 @@ use std::str::FromStr; /// The name of a runtime library routine. /// -/// Runtime library calls are generated for Cretonne IL instructions that don't have an equivalent +/// Runtime library calls are generated for Cretonne IR instructions that don't have an equivalent /// ISA instruction or an easy macro expansion. A `LibCall` is used as a well-known name to refer to /// the runtime library routine. This way, Cretonne doesn't have to know about the naming /// convention in the embedding VM's runtime library. diff --git a/lib/cretonne/src/ir/mod.rs b/lib/cretonne/src/ir/mod.rs index 2144ad6811..4f4e671f30 100644 --- a/lib/cretonne/src/ir/mod.rs +++ b/lib/cretonne/src/ir/mod.rs @@ -1,4 +1,4 @@ -//! Representation of Cretonne IL functions. +//! Representation of Cretonne IR functions. pub mod types; pub mod entities; diff --git a/lib/cretonne/src/ir/progpoint.rs b/lib/cretonne/src/ir/progpoint.rs index ce5b108e54..8fea3193c6 100644 --- a/lib/cretonne/src/ir/progpoint.rs +++ b/lib/cretonne/src/ir/progpoint.rs @@ -12,7 +12,7 @@ use std::cmp; /// 1. An instruction or /// 2. An EBB header. /// -/// This corresponds more or less to the lines in the textual representation of Cretonne IL. +/// This corresponds more or less to the lines in the textual form of Cretonne IR. #[derive(PartialEq, Eq, Clone, Copy)] pub struct ProgramPoint(u32); diff --git a/lib/cretonne/src/ir/sourceloc.rs b/lib/cretonne/src/ir/sourceloc.rs index 36e5247488..768bbf99d5 100644 --- a/lib/cretonne/src/ir/sourceloc.rs +++ b/lib/cretonne/src/ir/sourceloc.rs @@ -7,7 +7,7 @@ use std::fmt; /// A source location. /// -/// This is an opaque 32-bit number attached to each Cretonne IL instruction. Cretonne does not +/// This is an opaque 32-bit number attached to each Cretonne IR instruction. Cretonne does not /// interpret source locations in any way, they are simply preserved from the input to the output. /// /// The default source location uses the all-ones bit pattern `!0`. It is used for instructions diff --git a/lib/cretonne/src/legalizer/globalvar.rs b/lib/cretonne/src/legalizer/globalvar.rs index 901b0da416..27494bfd87 100644 --- a/lib/cretonne/src/legalizer/globalvar.rs +++ b/lib/cretonne/src/legalizer/globalvar.rs @@ -45,7 +45,7 @@ fn vmctx_addr(inst: ir::Inst, func: &mut ir::Function, offset: i64) { /// Expand a `global_addr` instruction for a deref global. fn deref_addr(inst: ir::Inst, func: &mut ir::Function, base: ir::GlobalVar, offset: i64) { // We need to load a pointer from the `base` global variable, so insert a new `global_addr` - // instruction. This depends on the iterative legalization loop. Note that the IL verifier + // instruction. This depends on the iterative legalization loop. Note that the IR verifier // detects any cycles in the `deref` globals. let ptr_ty = func.dfg.value_type(func.dfg.first_result(inst)); let mut pos = FuncCursor::new(func).at_inst(inst); diff --git a/lib/cretonne/src/regalloc/diversion.rs b/lib/cretonne/src/regalloc/diversion.rs index 16eb0e9b50..68fd04754e 100644 --- a/lib/cretonne/src/regalloc/diversion.rs +++ b/lib/cretonne/src/regalloc/diversion.rs @@ -15,7 +15,7 @@ use std::vec::Vec; /// A diversion of a value from its original location to a new register or stack location. /// -/// In IL, a diversion is represented by a `regmove` instruction, possibly a chain of them for the +/// In IR, a diversion is represented by a `regmove` instruction, possibly a chain of them for the /// same value. /// /// When tracking diversions, the `from` field is the original assigned value location, and `to` is diff --git a/lib/cretonne/src/result.rs b/lib/cretonne/src/result.rs index aa209a0845..bd2ae5a101 100644 --- a/lib/cretonne/src/result.rs +++ b/lib/cretonne/src/result.rs @@ -15,9 +15,9 @@ pub enum CtonError { /// code. This should never happen for validated WebAssembly code. InvalidInput, - /// An IL verifier error. + /// An IR verifier error. /// - /// This always represents a bug, either in the code that generated IL for Cretonne, or a bug + /// This always represents a bug, either in the code that generated IR for Cretonne, or a bug /// in Cretonne itself. Verifier(verifier::Error), diff --git a/lib/cretonne/src/timing.rs b/lib/cretonne/src/timing.rs index 647e0a07aa..51cdd85bfa 100644 --- a/lib/cretonne/src/timing.rs +++ b/lib/cretonne/src/timing.rs @@ -41,11 +41,11 @@ define_passes!{ Pass, NUM_PASSES, DESCRIPTIONS; process_file: "Processing test file", - parse_text: "Parsing textual Cretonne IL", + parse_text: "Parsing textual Cretonne IR", wasm_translate_module: "Translate WASM module", wasm_translate_function: "Translate WASM function", - verifier: "Verify Cretonne IL", + verifier: "Verify Cretonne IR", verify_cssa: "Verify CSSA", verify_liveness: "Verify live ranges", verify_locations: "Verify value locations", diff --git a/lib/cretonne/src/write.rs b/lib/cretonne/src/write.rs index bbe8375b89..1081a87d77 100644 --- a/lib/cretonne/src/write.rs +++ b/lib/cretonne/src/write.rs @@ -1,8 +1,7 @@ -//! Converting Cretonne IL to text. +//! Converting Cretonne IR to text. //! -//! The `write` module provides the `write_function` function which converts an IL `Function` to an -//! equivalent textual representation. This textual representation can be read back by the -//! `cretonne-reader` crate. +//! The `write` module provides the `write_function` function which converts an IR `Function` to an +//! equivalent textual form. This textual form can be read back by the `cretonne-reader` crate. use ir::{Function, DataFlowGraph, Ebb, Inst, Value, ValueDef, Type, SigRef}; use isa::{TargetIsa, RegInfo}; diff --git a/lib/filetests/src/test_legalizer.rs b/lib/filetests/src/test_legalizer.rs index c8d03e4c2a..08f6c53ae4 100644 --- a/lib/filetests/src/test_legalizer.rs +++ b/lib/filetests/src/test_legalizer.rs @@ -1,4 +1,4 @@ -//! Test command for checking the IL legalizer. +//! Test command for checking the IR legalizer. //! //! The `test legalizer` test command runs each function through `legalize_function()` and sends //! the result to filecheck. diff --git a/lib/filetests/src/test_print_cfg.rs b/lib/filetests/src/test_print_cfg.rs index 470d293185..b043dc58b2 100644 --- a/lib/filetests/src/test_print_cfg.rs +++ b/lib/filetests/src/test_print_cfg.rs @@ -1,6 +1,6 @@ //! The `print-cfg` sub-command. //! -//! Read a series of Cretonne IL files and print their control flow graphs +//! Read a series of Cretonne IR files and print their control flow graphs //! in graphviz format. use std::borrow::Cow; diff --git a/lib/filetests/src/test_verifier.rs b/lib/filetests/src/test_verifier.rs index bb4375b59e..6db9c681ce 100644 --- a/lib/filetests/src/test_verifier.rs +++ b/lib/filetests/src/test_verifier.rs @@ -1,4 +1,4 @@ -//! Test command for checking the IL verifier. +//! Test command for checking the IR verifier. //! //! The `test verifier` test command looks for annotations on instructions like this: //! diff --git a/lib/frontend/Cargo.toml b/lib/frontend/Cargo.toml index 40f1833c71..0bef102c66 100644 --- a/lib/frontend/Cargo.toml +++ b/lib/frontend/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Cretonne Project Developers"] name = "cretonne-frontend" version = "0.4.1" -description = "Cretonne IL builder helper" +description = "Cretonne IR builder helper" license = "Apache-2.0" documentation = "https://cretonne.readthedocs.io/" repository = "https://github.com/Cretonne/cretonne" diff --git a/lib/frontend/README.md b/lib/frontend/README.md index 53248b68ab..cca2b12ab5 100644 --- a/lib/frontend/README.md +++ b/lib/frontend/README.md @@ -1,5 +1,5 @@ This crate provides a straightforward way to create a -[Cretonne](https://crates.io/crates/cretonne) IL function and fill it with +[Cretonne](https://crates.io/crates/cretonne) IR function and fill it with instructions translated from another language. It contains an SSA construction module that provides convenient methods for translating non-SSA variables into -SSA Cretonne IL values via `use_var` and `def_var` calls. +SSA Cretonne IR values via `use_var` and `def_var` calls. diff --git a/lib/frontend/src/frontend.rs b/lib/frontend/src/frontend.rs index 8cd2c5cc82..2706846124 100644 --- a/lib/frontend/src/frontend.rs +++ b/lib/frontend/src/frontend.rs @@ -1,4 +1,4 @@ -//! A frontend for building Cretonne IL from other languages. +//! A frontend for building Cretonne IR from other languages. use cretonne::cursor::{Cursor, FuncCursor}; use cretonne::ir; use cretonne::ir::{Ebb, Type, Value, Function, Inst, JumpTable, StackSlot, JumpTableData, @@ -10,7 +10,7 @@ use ssa::{SSABuilder, SideEffects, Block}; use cretonne::entity::{EntityRef, EntityMap, EntitySet}; use cretonne::packed_option::PackedOption; -/// Structure used for translating a series of functions into Cretonne IL. +/// Structure used for translating a series of functions into Cretonne IR. /// /// In order to reduce memory reallocations when compiling multiple functions, /// `FunctionBuilderContext` holds various data structures which are cleared between @@ -29,7 +29,7 @@ where } -/// Temporary object used to build a single Cretonne IL `Function`. +/// Temporary object used to build a single Cretonne IR `Function`. pub struct FunctionBuilder<'a, Variable: 'a> where Variable: EntityRef, @@ -103,7 +103,7 @@ where } /// Implementation of the [`InstBuilder`](../cretonne/ir/builder/trait.InstBuilder.html) that has -/// one convenience method per Cretonne IL instruction. +/// one convenience method per Cretonne IR instruction. pub struct FuncInstBuilder<'short, 'long: 'short, Variable: 'long> where Variable: EntityRef, @@ -191,7 +191,7 @@ impl<'short, 'long, Variable> InstBuilderBase<'short> for FuncInstBuilder<'short } } -/// This module allows you to create a function in Cretonne IL in a straightforward way, hiding +/// This module allows you to create a function in Cretonne IR in a straightforward way, hiding /// all the complexity of its internal representation. /// /// The module is parametrized by one type which is the representation of variables in your @@ -203,10 +203,10 @@ impl<'short, 'long, Variable> InstBuilderBase<'short> for FuncInstBuilder<'short /// - the last instruction of each block is a terminator instruction which has no natural successor, /// and those instructions can only appear at the end of extended blocks. /// -/// The parameters of Cretonne IL instructions are Cretonne IL values, which can only be created -/// as results of other Cretonne IL instructions. To be able to create variables redefined multiple +/// The parameters of Cretonne IR instructions are Cretonne IR values, which can only be created +/// as results of other Cretonne IR instructions. To be able to create variables redefined multiple /// times in your program, use the `def_var` and `use_var` command, that will maintain the -/// correspondence between your variables and Cretonne IL SSA values. +/// correspondence between your variables and Cretonne IR SSA values. /// /// The first block for which you call `switch_to_block` will be assumed to be the beginning of /// the function. @@ -220,7 +220,7 @@ impl<'short, 'long, Variable> InstBuilderBase<'short> for FuncInstBuilder<'short /// /// # Errors /// -/// The functions below will panic in debug mode whenever you try to modify the Cretonne IL +/// The functions below will panic in debug mode whenever you try to modify the Cretonne IR /// function in a way that violate the coherence of the code. For instance: switching to a new /// `Ebb` when you haven't filled the current one with a terminator instruction, inserting a /// return instruction with arguments that don't match the function's signature. @@ -311,7 +311,7 @@ where self.func_ctx.types[var] = ty; } - /// Returns the Cretonne IL value corresponding to the utilization at the current program + /// Returns the Cretonne IR value corresponding to the utilization at the current program /// position of a previously defined user variable. pub fn use_var(&mut self, var: Variable) -> Value { let ty = *self.func_ctx.types.get(var).expect( @@ -462,8 +462,8 @@ where } /// All the functions documented in the previous block are write-only and help you build a valid -/// Cretonne IL functions via multiple debug asserts. However, you might need to improve the -/// performance of your translation perform more complex transformations to your Cretonne IL +/// Cretonne IR functions via multiple debug asserts. However, you might need to improve the +/// performance of your translation perform more complex transformations to your Cretonne IR /// function. The functions below help you inspect the function you're creating and modify it /// in ways that can be unsafe if used incorrectly. impl<'a, Variable> FunctionBuilder<'a, Variable> diff --git a/lib/frontend/src/lib.rs b/lib/frontend/src/lib.rs index 1f2c2e0db8..c7defce3bb 100644 --- a/lib/frontend/src/lib.rs +++ b/lib/frontend/src/lib.rs @@ -1,15 +1,15 @@ -//! Cretonne IL builder library. +//! Cretonne IR builder library. //! -//! Provides a straightforward way to create a Cretonne IL function and fill it with instructions +//! Provides a straightforward way to create a Cretonne IR function and fill it with instructions //! translated from another language. Contains an SSA construction module that lets you translate -//! your non-SSA variables into SSA Cretonne IL values via `use_var` and `def_var` calls. +//! your non-SSA variables into SSA Cretonne IR values via `use_var` and `def_var` calls. //! //! To get started, create an [`FunctionBuilderContext`](struct.FunctionBuilderContext.html) and //! pass it as an argument to a [`FunctionBuilder`](struct.FunctionBuilder.html). //! //! # Example //! -//! Here is a pseudo-program we want to transform into Cretonne IL: +//! Here is a pseudo-program we want to transform into Cretonne IR: //! //! ```cton //! function(x) { @@ -29,7 +29,7 @@ //! } //! ``` //! -//! Here is how you build the corresponding Cretonne IL function using `FunctionBuilderContext`: +//! Here is how you build the corresponding Cretonne IR function using `FunctionBuilderContext`: //! //! ```rust //! extern crate cretonne; diff --git a/lib/frontend/src/ssa.rs b/lib/frontend/src/ssa.rs index bd4a8d89fd..af0d35695e 100644 --- a/lib/frontend/src/ssa.rs +++ b/lib/frontend/src/ssa.rs @@ -231,7 +231,7 @@ fn emit_zero(ty: Type, mut cur: FuncCursor) -> Value { } } /// The following methods are the API of the SSA builder. Here is how it should be used when -/// translating to Cretonne IL: +/// translating to Cretonne IR: /// /// - for each sequence of contiguous instructions (with no branches), create a corresponding /// basic block with `declare_ebb_body_block` or `declare_ebb_header_block` depending on the diff --git a/lib/reader/Cargo.toml b/lib/reader/Cargo.toml index 80fab0f499..d8259a2027 100644 --- a/lib/reader/Cargo.toml +++ b/lib/reader/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The Cretonne Project Developers"] name = "cretonne-reader" version = "0.4.1" -description = "Cretonne textual IL reader" +description = "Cretonne textual IR reader" license = "Apache-2.0" documentation = "https://cretonne.readthedocs.io/" repository = "https://github.com/Cretonne/cretonne" diff --git a/lib/reader/src/parser.rs b/lib/reader/src/parser.rs index 384de9381b..b165756566 100644 --- a/lib/reader/src/parser.rs +++ b/lib/reader/src/parser.rs @@ -1782,7 +1782,7 @@ impl<'a> Parser<'a> { // explicit type specified. Look up `ctrl_value` to see if it was defined // already. // TBD: If it is defined in another block, the type should have been - // specified explicitly. It is unfortunate that the correctness of IL + // specified explicitly. It is unfortunate that the correctness of IR // depends on the layout of the blocks. let ctrl_src_value = inst_data .typevar_operand(&ctx.function.dfg.value_lists) diff --git a/lib/wasm/Cargo.toml b/lib/wasm/Cargo.toml index 0fcd2210f5..b532f29c55 100644 --- a/lib/wasm/Cargo.toml +++ b/lib/wasm/Cargo.toml @@ -2,7 +2,7 @@ name = "cretonne-wasm" version = "0.4.1" authors = ["The Cretonne Project Developers"] -description = "Translator from WebAssembly to Cretonne IL" +description = "Translator from WebAssembly to Cretonne IR" repository = "https://github.com/Cretonne/cretonne" license = "Apache-2.0" readme = "README.md" diff --git a/lib/wasm/README.md b/lib/wasm/README.md index f12f00d46a..946a41f26d 100644 --- a/lib/wasm/README.md +++ b/lib/wasm/README.md @@ -1,3 +1,2 @@ This crate performs the translation from a wasm module in binary format to the -in-memory representation of the [Cretonne](https://crates.io/crates/cretonne) -IL. +in-memory form of the [Cretonne](https://crates.io/crates/cretonne) IR. diff --git a/lib/wasm/src/code_translator.rs b/lib/wasm/src/code_translator.rs index 69111dc8e8..61b7118636 100644 --- a/lib/wasm/src/code_translator.rs +++ b/lib/wasm/src/code_translator.rs @@ -1,5 +1,5 @@ //! This module contains the bulk of the interesting code performing the translation between -//! WebAssembly and Cretonne IL. +//! WebAssembly and Cretonne IR. //! //! The translation is done in one pass, opcode by opcode. Two main data structures are used during //! code translations: the value stack and the control stack. The value stack mimics the execution @@ -38,7 +38,7 @@ use std::vec::Vec; // Clippy warns about "flags: _" but its important to document that the flags field is ignored #[cfg_attr(feature = "cargo-clippy", allow(unneeded_field_pattern))] -/// Translates wasm operators into Cretonne IL instructions. Returns `true` if it inserted +/// Translates wasm operators into Cretonne IR instructions. Returns `true` if it inserted /// a return. pub fn translate_operator( op: Operator, diff --git a/lib/wasm/src/environ/spec.rs b/lib/wasm/src/environ/spec.rs index 41583c1185..233188364a 100644 --- a/lib/wasm/src/environ/spec.rs +++ b/lib/wasm/src/environ/spec.rs @@ -26,7 +26,7 @@ pub enum GlobalValue { /// Environment affecting the translation of a single WebAssembly function. /// /// A `FuncEnvironment` trait object is required to translate a WebAssembly function to Cretonne -/// IL. The function environment provides information about the WebAssembly module as well as the +/// IR. The function environment provides information about the WebAssembly module as well as the /// runtime environment. pub trait FuncEnvironment { /// Get the flags for the current compilation. diff --git a/lib/wasm/src/func_translator.rs b/lib/wasm/src/func_translator.rs index 5ac69b07b8..dbb1fc9bcc 100644 --- a/lib/wasm/src/func_translator.rs +++ b/lib/wasm/src/func_translator.rs @@ -1,7 +1,7 @@ -//! Stand-alone WebAssembly to Cretonne IL translator. +//! Stand-alone WebAssembly to Cretonne IR translator. //! //! This module defines the `FuncTranslator` type which can translate a single WebAssembly -//! function to Cretonne IL guided by a `FuncEnvironment` which provides information about the +//! function to Cretonne IR guided by a `FuncEnvironment` which provides information about the //! WebAssembly module and the runtime environment. use code_translator::translate_operator; @@ -14,9 +14,9 @@ use environ::FuncEnvironment; use state::TranslationState; use wasmparser::{self, BinaryReader}; -/// WebAssembly to Cretonne IL function translator. +/// WebAssembly to Cretonne IR function translator. /// -/// A `FuncTranslator` is used to translate a binary WebAssembly function into Cretonne IL guided +/// A `FuncTranslator` is used to translate a binary WebAssembly function into Cretonne IR guided /// by a `FuncEnvironment` object. A single translator instance can be reused to translate multiple /// functions which will reduce heap allocation traffic. pub struct FuncTranslator { diff --git a/lib/wasm/src/lib.rs b/lib/wasm/src/lib.rs index f2a1adb7cb..cc35a19fbc 100644 --- a/lib/wasm/src/lib.rs +++ b/lib/wasm/src/lib.rs @@ -1,5 +1,5 @@ -//! Performs the translation from a wasm module in binary format to the in-memory representation -//! of the Cretonne IL. More particularly, it translates the code of all the functions bodies and +//! Performs translation from a wasm module in binary format to the in-memory form +//! of Cretonne IR. More particularly, it translates the code of all the functions bodies and //! interacts with an environment implementing the //! [`ModuleEnvironment`](trait.ModuleEnvironment.html) //! trait to deal with tables, globals and linear memory. diff --git a/lib/wasm/src/module_translator.rs b/lib/wasm/src/module_translator.rs index bb74db4276..171f720e12 100644 --- a/lib/wasm/src/module_translator.rs +++ b/lib/wasm/src/module_translator.rs @@ -10,7 +10,7 @@ use environ::ModuleEnvironment; use std::string::String; -/// Translate a sequence of bytes forming a valid Wasm binary into a list of valid Cretonne IL +/// Translate a sequence of bytes forming a valid Wasm binary into a list of valid Cretonne IR /// [`Function`](../cretonne/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.