Rename Cretonne to Cranelift!
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
//! Cretonne instruction builder.
|
||||
//! Cranelift instruction builder.
|
||||
//!
|
||||
//! A `Builder` provides a convenient interface for inserting instructions into a Cretonne
|
||||
//! A `Builder` provides a convenient interface for inserting instructions into a Cranelift
|
||||
//! function. Many of its methods are generated from the meta language instruction definitions.
|
||||
|
||||
use ir;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Condition codes for the Cretonne code generator.
|
||||
//! Condition codes for the Cranelift code generator.
|
||||
//!
|
||||
//! A condition code here is an enumerated type that determined how to compare two numbers. There
|
||||
//! are different rules for comparing integers and floating point numbers, so they use different
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! Cretonne IR entity references.
|
||||
//! Cranelift IR entity references.
|
||||
//!
|
||||
//! Instructions in Cretonne IR need to reference other entities in the function. This can be other
|
||||
//! Instructions in Cranelift 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.
|
||||
//!
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! External function calls.
|
||||
//!
|
||||
//! To a Cretonne function, all functions are "external". Directly called functions must be
|
||||
//! To a Cranelift function, all functions are "external". Directly called functions must be
|
||||
//! declared in the preamble, and all function calls must have a signature.
|
||||
//!
|
||||
//! This module declares the data types used to represent external functions and call signatures.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//!
|
||||
//! These are identifiers for declaring entities defined outside the current
|
||||
//! function. The name of an external declaration doesn't have any meaning to
|
||||
//! Cretonne, which compiles functions independently.
|
||||
//! Cranelift, which compiles functions independently.
|
||||
|
||||
use ir::LibCall;
|
||||
use std::cmp;
|
||||
@@ -15,16 +15,16 @@ const TESTCASE_NAME_LENGTH: usize = 16;
|
||||
/// table, or a short sequence of ascii bytes so that test cases do not have
|
||||
/// to keep track of a sy mbol table.
|
||||
///
|
||||
/// External names are primarily used as keys by code using Cretonne to map
|
||||
/// from a `cretonne_codegen::ir::FuncRef` or similar to additional associated
|
||||
/// External names are primarily used as keys by code using Cranelift to map
|
||||
/// from a `cranelift_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
|
||||
/// In particular, many `.clif` test files use function names to identify
|
||||
/// functions.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum ExternalName {
|
||||
/// A name in a user-defined symbol table. Cretonne does not interpret
|
||||
/// A name in a user-defined symbol table. Cranelift does not interpret
|
||||
/// these numbers in any way.
|
||||
User {
|
||||
/// Arbitrary.
|
||||
@@ -51,7 +51,7 @@ impl ExternalName {
|
||||
/// # Examples
|
||||
///
|
||||
/// ```rust
|
||||
/// # use cretonne_codegen::ir::ExternalName;
|
||||
/// # use cranelift_codegen::ir::ExternalName;
|
||||
/// // Create `ExternalName` from a string.
|
||||
/// let name = ExternalName::testcase("hello");
|
||||
/// assert_eq!(name.to_string(), "%hello");
|
||||
@@ -72,7 +72,7 @@ impl ExternalName {
|
||||
///
|
||||
/// # Examples
|
||||
/// ```rust
|
||||
/// # use cretonne_codegen::ir::ExternalName;
|
||||
/// # use cranelift_codegen::ir::ExternalName;
|
||||
/// // Create `ExternalName` from integer indicies
|
||||
/// let name = ExternalName::user(123, 456);
|
||||
/// assert_eq!(name.to_string(), "u123:456");
|
||||
|
||||
@@ -23,7 +23,7 @@ use write::write_function;
|
||||
/// The clone will have all the same entity numbers as the original.
|
||||
#[derive(Clone)]
|
||||
pub struct Function {
|
||||
/// Name of this function. Mostly used by `.cton` files.
|
||||
/// Name of this function. Mostly used by `.clif` files.
|
||||
pub name: ExternalName,
|
||||
|
||||
/// Signature of this function.
|
||||
@@ -68,7 +68,7 @@ pub struct Function {
|
||||
/// Source locations.
|
||||
///
|
||||
/// Track the original source location for each instruction. The source locations are not
|
||||
/// interpreted by Cretonne, only preserved.
|
||||
/// interpreted by Cranelift, only preserved.
|
||||
pub srclocs: SourceLocs,
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ pub enum GlobalValueData {
|
||||
offset: Offset32,
|
||||
},
|
||||
|
||||
/// Value is identified by a symbolic name. Cretonne itself does not interpret this name;
|
||||
/// Value is identified by a symbolic name. Cranelift itself does not interpret this name;
|
||||
/// it's used by embedders to link with other data structures.
|
||||
Sym {
|
||||
/// The symbolic name.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//! Immediate operands for Cretonne instructions
|
||||
//! Immediate operands for Cranelift instructions
|
||||
//!
|
||||
//! This module defines the types of immediate operands that can appear on Cretonne instructions.
|
||||
//! Each type here should have a corresponding definition in the `cretonne.immediates` Python
|
||||
//! This module defines the types of immediate operands that can appear on Cranelift instructions.
|
||||
//! Each type here should have a corresponding definition in the `cranelift.immediates` Python
|
||||
//! module in the meta language.
|
||||
|
||||
use std::fmt::{self, Display, Formatter};
|
||||
|
||||
@@ -64,7 +64,7 @@ impl Opcode {
|
||||
}
|
||||
}
|
||||
|
||||
// This trait really belongs in lib/reader where it is used by the `.cton` file parser, but since
|
||||
// This trait really belongs in lib/reader where it is used by the `.clif` file parser, but since
|
||||
// it critically depends on the `opcode_name()` function which is needed here anyway, it lives in
|
||||
// this module. This also saves us from running the build script twice to generate code for the two
|
||||
// separate crates.
|
||||
|
||||
@@ -11,9 +11,9 @@ use std::str::FromStr;
|
||||
|
||||
/// The name of a runtime library routine.
|
||||
///
|
||||
/// Runtime library calls are generated for Cretonne IR instructions that don't have an equivalent
|
||||
/// Runtime library calls are generated for Cranelift 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
|
||||
/// the runtime library routine. This way, Cranelift doesn't have to know about the naming
|
||||
/// convention in the embedding VM's runtime library.
|
||||
///
|
||||
/// This list is likely to grow over time.
|
||||
|
||||
@@ -51,10 +51,10 @@ impl MemFlags {
|
||||
/// Test if the `notrap` flag is set.
|
||||
///
|
||||
/// Normally, trapping is part of the semantics of a load/store operation. If the platform
|
||||
/// would cause a trap when accessing the effective address, the Cretonne memory operation is
|
||||
/// would cause a trap when accessing the effective address, the Cranelift memory operation is
|
||||
/// also required to trap.
|
||||
///
|
||||
/// The `notrap` flag tells Cretonne that the memory is *accessible*, which means that
|
||||
/// The `notrap` flag tells Cranelift that the memory is *accessible*, which means that
|
||||
/// accesses will not trap. This makes it possible to delete an unused load or a dead store
|
||||
/// instruction.
|
||||
pub fn notrap(self) -> bool {
|
||||
@@ -68,7 +68,7 @@ impl MemFlags {
|
||||
|
||||
/// Test if the `aligned` flag is set.
|
||||
///
|
||||
/// By default, Cretonne memory instructions work with any unaligned effective address. If the
|
||||
/// By default, Cranelift memory instructions work with any unaligned effective address. If the
|
||||
/// `aligned` flag is set, the instruction is permitted to trap or return a wrong result if the
|
||||
/// effective address is misaligned.
|
||||
pub fn aligned(self) -> bool {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Representation of Cretonne IR functions.
|
||||
//! Representation of Cranelift IR functions.
|
||||
|
||||
mod builder;
|
||||
pub mod condcodes;
|
||||
|
||||
@@ -12,7 +12,7 @@ use std::u32;
|
||||
/// 1. An instruction or
|
||||
/// 2. An EBB header.
|
||||
///
|
||||
/// This corresponds more or less to the lines in the textual form of Cretonne IR.
|
||||
/// This corresponds more or less to the lines in the textual form of Cranelift IR.
|
||||
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||
pub struct ProgramPoint(u32);
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
//! Source locations.
|
||||
//!
|
||||
//! Cretonne tracks the original source location of each instruction, and preserves the source
|
||||
//! Cranelift tracks the original source location of each instruction, and preserves the source
|
||||
//! location when instructions are transformed.
|
||||
|
||||
use std::fmt;
|
||||
|
||||
/// A source location.
|
||||
///
|
||||
/// This is an opaque 32-bit number attached to each Cretonne IR instruction. Cretonne does not
|
||||
/// This is an opaque 32-bit number attached to each Cranelift IR instruction. Cranelift 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
|
||||
|
||||
@@ -15,7 +15,7 @@ use std::vec::Vec;
|
||||
|
||||
/// The size of an object on the stack, or the size of a stack frame.
|
||||
///
|
||||
/// We don't use `usize` to represent object sizes on the target platform because Cretonne supports
|
||||
/// We don't use `usize` to represent object sizes on the target platform because Cranelift supports
|
||||
/// cross-compilation, and `usize` is a type that depends on the host platform, not the target
|
||||
/// platform.
|
||||
pub type StackSize = u32;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//! Common types for the Cretonne code generator.
|
||||
//! Common types for the Cranelift code generator.
|
||||
|
||||
use std::default::Default;
|
||||
use std::fmt::{self, Debug, Display, Formatter};
|
||||
|
||||
Reference in New Issue
Block a user