File stale path references.

After rearranging the directory layout, some paths in documentation
needed updating.

Fix some typos too.
This commit is contained in:
Jakob Stoklund Olesen
2016-10-24 13:27:10 -07:00
parent 84faddbf65
commit b6ff2621f9
11 changed files with 32 additions and 27 deletions

View File

@@ -23,7 +23,7 @@ Unit tests
Unit test live in a ``tests`` sub-module of the code they are testing::
pub fn add(x: u32, y: u32) {
pub fn add(x: u32, y: u32) -> u32 {
x + y
}
@@ -62,19 +62,21 @@ tested::
These tests are useful for demonstrating how to use an API, and running them
regularly makes sure that they stay up to date. Documentation tests are not
appropriate for lots of assertions, use unit tests for that.
appropriate for lots of assertions; use unit tests for that.
Integration tests
-----------------
Integration tests are Rust source files thar are compiled and linked
Integration tests are Rust source files that are compiled and linked
individually. They are used to exercise the external API of the crates under
test.
These tests are usually found in the :file:`src/tools/tests` sub-directory where they
have access to all the crates in the Cretonne repository. The
:file:`libcretonne` and :file:`libreader` crates have no external dependencies
which can make testing tedious.
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
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
:file:`lib/reader/tests`.
File tests
==========
@@ -107,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:`meta/isa/*/setings.py`.
:file:`lib/cretonne/meta/isa/*/settings.py`.
All types of tests allow shared Cretonne settings to be modified:
@@ -117,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:`meta/cretonne/settings.py`.
:file:`lib/cretonne/meta/cretonne/settings.py`.
The ``set`` lines apply settings cumulatively::
@@ -139,7 +141,8 @@ Filecheck
Many of the test commands bescribed below use *filecheck* to verify their
output. Filecheck is a Rust implementation of the LLVM tool of the same name.
See the :file:`libfilecheck` documentation for details of its syntax.
See the :file:`lib/filecheck` `documentation <https://docs.rs/filecheck/>`_ for
details of its syntax.
Comments in :file:`.cton` files are associated with the entity they follow.
This typically means and instruction or the whole function. Those tests that
@@ -225,7 +228,7 @@ reported location of the error is verified::
return
}
This example test passed if the verifier fails with an error message containing
This example test passes if the verifier fails with an error message containing
the sub-string ``"terminator"`` *and* the error is reported for the ``jump``
instruction.

View File

@@ -1,6 +1,6 @@
# Second-level build script.
#
# This script is run from src/libcretonne/build.rs to generate Rust files.
# This script is run from lib/cretonne/build.rs to generate Rust files.
from __future__ import absolute_import
import argparse

View File

@@ -1,7 +1,7 @@
"""
Generate build dependencies for Cargo.
The `build.py` script is invoked by cargo when building libcretonne to
The `build.py` script is invoked by cargo when building lib/cretonne to
generate Rust code from the instruction descriptions. Cargo needs to know when
it is necessary to rerun the build script.

View File

@@ -2,7 +2,7 @@
Generate sources with type info.
This generates a `types.rs` file which is included in
`libcretonne/ir/types/rs`. The file provides constant definitions for the most
`lib/cretonne/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.

View File

@@ -1,7 +1,7 @@
//! Runtime support for precomputed constant hash tables.
//!
//! The `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:
//! The `lib/cretonne/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.
//! - Contain at least one empty slot.
@@ -52,7 +52,7 @@ pub fn probe<K: Copy + Eq, T: Table<K> + ?Sized>(table: &T, key: K, hash: usize)
}
/// A primitive hash function for matching opcodes.
/// Must match `meta/constant_hash.py`.
/// Must match `lib/cretonne/meta/constant_hash.py`.
pub fn simple_hash(s: &str) -> usize {
let mut h: u32 = 5381;
for c in s.chars() {

View File

@@ -39,7 +39,7 @@ pub trait InstBuilderBase<'f>: Sized {
-> (Inst, &'f mut DataFlowGraph);
}
// Include trait code generated by `meta/gen_instr.py`.
// Include trait code generated by `lib/cretonne/meta/gen_instr.py`.
//
// This file defines the `InstBuilder` trait as an extension of `InstBuilderBase` with methods per
// instruction format and per opcode.

View File

@@ -15,7 +15,7 @@ use ir::immediates::{Imm64, Uimm8, Ieee32, Ieee64, ImmVector};
use ir::condcodes::*;
use ir::types;
// Include code generated by `meta/gen_instr.py`. This file contains:
// Include code generated by `lib/cretonne/meta/gen_instr.py`. This file contains:
//
// - The `pub enum InstructionFormat` enum with all the instruction formats.
// - The `pub enum Opcode` definition with all known opcodes,
@@ -54,9 +54,9 @@ impl Opcode {
}
}
// This trait really belongs in libreader where it is used by the .cton file parser, but since it
// This trait really belongs in lib/reader where it is used by the .cton 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 runing the build script twice to generate code for the two
// module. This also saves us from running the build script twice to generate code for the two
// separate crates.
impl FromStr for Opcode {
type Err = &'static str;

View File

@@ -30,8 +30,9 @@ pub struct Type(u8);
/// a SIMD vector.
pub const VOID: Type = Type(0);
// Include code generated by `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 code generated by `lib/cretonne/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"));
impl Type {

View File

@@ -1,7 +1,7 @@
//! Support types for generated encoding tables.
//!
//! This module contains types and functions for working with the encoding tables generated by
//! `meta/gen_encoding.py`.
//! `lib/cretonne/meta/gen_encoding.py`.
use ir::{Type, Opcode};
use isa::Encoding;
use constant_hash::{Table, probe};

View File

@@ -3,8 +3,9 @@
use settings::{self, detail, Builder};
use std::fmt;
// 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 `meta/cretonne/settings.py`.
// Include code generated by `lib/cretonne/meta/gen_settings.py`. This file contains a public
// `Flags` struct with an impl for all of the settings defined in
// `lib/cretonne/meta/cretonne/settings.py`.
include!(concat!(env!("OUT_DIR"), "/settings-riscv.rs"));
#[cfg(test)]

View File

@@ -1,7 +1,7 @@
//! Predicate functions for testing instruction fields.
//!
//! This module defines functions that are used by the instruction predicates defined by
//! `meta/cretonne/predicates.py` classes.
//! `lib/cretonne/meta/cretonne/predicates.py` classes.
//!
//! The predicates the operate on integer fields use `Into<i64>` as a shared trait bound. This
//! bound is implemented by all the native integer types as well as `Imm64`.