Rename Cretonne to Cranelift!

This commit is contained in:
Dan Gohman
2018-07-13 09:01:28 -07:00
parent 19a636af96
commit f4dbd38a4c
306 changed files with 977 additions and 975 deletions

View File

@@ -1,9 +1,9 @@
//! The `cat` sub-command.
//!
//! Read a sequence of Cretonne IR files and print them again to stdout. This has the effect of
//! Read a sequence of Cranelift IR files and print them again to stdout. This has the effect of
//! normalizing formatting and removing comments.
use cretonne_reader::parse_functions;
use cranelift_reader::parse_functions;
use utils::read_to_string;
use CommandResult;

View File

@@ -10,9 +10,9 @@
#[macro_use]
extern crate cfg_if;
extern crate cretonne_codegen;
extern crate cretonne_filetests;
extern crate cretonne_reader;
extern crate cranelift_codegen;
extern crate cranelift_filetests;
extern crate cranelift_reader;
extern crate docopt;
extern crate filecheck;
#[macro_use]
@@ -23,14 +23,14 @@ extern crate term;
cfg_if! {
if #[cfg(feature = "wasm")] {
extern crate cretonne_wasm;
extern crate cranelift_wasm;
extern crate wabt;
mod wasm;
}
}
extern crate target_lexicon;
use cretonne_codegen::{timing, VERSION};
use cranelift_codegen::{timing, VERSION};
use docopt::Docopt;
use std::io::{self, Write};
use std::process;
@@ -42,33 +42,33 @@ mod rsfilecheck;
mod utils;
const USAGE: &str = "
Cretonne code generator utility
Cranelift code generator utility
Usage:
cton-util test [-vT] <file>...
cton-util cat <file>...
cton-util filecheck [-v] <file>
cton-util print-cfg <file>...
cton-util compile [-vpT] [--set <set>]... [--target <triple>] <file>...
cton-util wasm [-ctvpTs] [--set <set>]... [--target <triple>] <file>...
cton-util --help | --version
clif-util test [-vT] <file>...
clif-util cat <file>...
clif-util filecheck [-v] <file>
clif-util print-cfg <file>...
clif-util compile [-vpT] [--set <set>]... [--target <triple>] <file>...
clif-util wasm [-ctvpTs] [--set <set>]... [--target <triple>] <file>...
clif-util --help | --version
Options:
-v, --verbose be more verbose
-T, --time-passes
print pass timing report
-t, --just-decode
just decode WebAssembly to Cretonne IR
just decode WebAssembly to Cranelift IR
-s, --print-size
prints generated code size
-c, --check-translation
just checks the correctness of Cretonne IR translated from WebAssembly
-p, --print print the resulting Cretonne IR
just checks the correctness of Cranelift IR translated from WebAssembly
-p, --print print the resulting Cranelift IR
-h, --help print this help message
--set=<set> configure Cretonne settings
--set=<set> configure Cranelift settings
--target=<triple>
specify the Cretonne target
--version print the Cretonne version
specify the Cranelift target
--version print the Cranelift version
";
@@ -95,19 +95,19 @@ struct Args {
pub type CommandResult = Result<(), String>;
/// Parse the command line arguments and run the requested command.
fn cton_util() -> CommandResult {
fn clif_util() -> CommandResult {
// Parse command line arguments.
let args: Args = Docopt::new(USAGE)
.and_then(|d| {
d.help(true)
.version(Some(format!("Cretonne {}", VERSION)))
.version(Some(format!("Cranelift {}", VERSION)))
.deserialize()
})
.unwrap_or_else(|e| e.exit());
// Find the sub-command to execute.
let result = if args.cmd_test {
cretonne_filetests::run(args.flag_verbose, &args.arg_file).map(|_time| ())
cranelift_filetests::run(args.flag_verbose, &args.arg_file).map(|_time| ())
} else if args.cmd_cat {
cat::run(&args.arg_file)
} else if args.cmd_filecheck {
@@ -135,7 +135,7 @@ fn cton_util() -> CommandResult {
);
#[cfg(not(feature = "wasm"))]
let result = Err("Error: cton-util was compiled without wasm support.".to_owned());
let result = Err("Error: clif-util was compiled without wasm support.".to_owned());
result
} else {
@@ -151,7 +151,7 @@ fn cton_util() -> CommandResult {
}
fn main() {
if let Err(mut msg) = cton_util() {
if let Err(mut msg) = clif_util() {
if !msg.ends_with('\n') {
msg.push('\n');
}

View File

@@ -1,11 +1,11 @@
//! CLI tool to read Cretonne IR files and compile them into native code.
//! CLI tool to read Cranelift IR files and compile them into native code.
use cretonne_codegen::isa::TargetIsa;
use cretonne_codegen::print_errors::pretty_error;
use cretonne_codegen::settings::FlagsOrIsa;
use cretonne_codegen::Context;
use cretonne_codegen::{binemit, ir};
use cretonne_reader::parse_test;
use cranelift_codegen::isa::TargetIsa;
use cranelift_codegen::print_errors::pretty_error;
use cranelift_codegen::settings::FlagsOrIsa;
use cranelift_codegen::Context;
use cranelift_codegen::{binemit, ir};
use cranelift_reader::parse_test;
use std::path::Path;
use std::path::PathBuf;
use utils::{parse_sets_and_triple, read_to_string};

View File

@@ -1,10 +1,10 @@
//! The `print-cfg` sub-command.
//!
//! Read a series of Cretonne IR files and print their control flow graphs
//! Read a series of Cranelift IR files and print their control flow graphs
//! in graphviz format.
use cretonne_codegen::cfg_printer::CFGPrinter;
use cretonne_reader::parse_functions;
use cranelift_codegen::cfg_printer::CFGPrinter;
use cranelift_reader::parse_functions;
use utils::read_to_string;
use CommandResult;

View File

@@ -1,9 +1,9 @@
//! Utility functions.
use cretonne_codegen::isa;
use cretonne_codegen::isa::TargetIsa;
use cretonne_codegen::settings::{self, FlagsOrIsa};
use cretonne_reader::{parse_options, Location};
use cranelift_codegen::isa;
use cranelift_codegen::isa::TargetIsa;
use cranelift_codegen::settings::{self, FlagsOrIsa};
use cranelift_reader::{parse_options, Location};
use std::fs::File;
use std::io::{self, Read};
use std::path::Path;

View File

@@ -1,13 +1,13 @@
//! CLI tool to use the functions provided by the [cretonne-wasm](../cretonne_wasm/index.html)
//! CLI tool to use the functions provided by the [cranelift-wasm](../cranelift_wasm/index.html)
//! crate.
//!
//! Reads Wasm binary files, translates the functions' code to Cretonne IR.
//! Reads Wasm binary files, translates the functions' code to Cranelift IR.
#![cfg_attr(feature = "cargo-clippy", allow(too_many_arguments, cyclomatic_complexity))]
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 cranelift_codegen::Context;
use cranelift_codegen::print_errors::{pretty_error, pretty_verifier_error};
use cranelift_codegen::settings::FlagsOrIsa;
use cranelift_wasm::{translate_module, DummyEnvironment, ModuleEnvironment};
use std::error::Error;
use std::path::Path;
use std::path::PathBuf;