Commit Graph

31 Commits

Author SHA1 Message Date
Andrew Brown
9cf90b836b Move iterate_files to the utils module 2020-05-07 16:51:09 -07:00
Benjamin Bouvier
6bee767129 clif-util: try both global and target-dependent settings when parsing --set flags; 2020-05-05 16:35:41 +02:00
Alex Crichton
3a13f79b66 Try to reduce CI times with a Rust *.wat parser (#1332)
This commit moves the cranelift tests and tools from the `wabt` crate on
crates.io (which compiles the wabt C++ codebase) to the `wat` crate on
crates.io which is a Rust parser for the `*.wat` format. This was
motivated by me noticing that release builds on Windows are ~5 minutes
longer than Linux builds, and local timing graphs showed that `wabt-sys`
was by far the longest build step in the build process.

This commit changes the `clif-util` binary where the `--enable-simd`
flag is no longer respected with the text format as input, since the
`wat` crate has no feature gating. This was already sort of not
respected, though, since `--enable-simd` wasn't consulted for binary
inputs which `clif-util` supports as well. If this isn't ok though then
it should be ok to close this PR!
2020-01-10 14:32:16 -08:00
yjh
1176e4f178 Fix clippy warnings (#1168) 2019-10-24 09:54:31 -06:00
Benjamin Bouvier
d7d48d5cc6 Add the dyn keyword before trait objects; 2019-06-24 11:42:26 +02:00
Dan Gohman
5adab629f2 Update to the rustfmt in rust 1.31, which is now stable. 2018-12-06 16:15:48 -05:00
Dan Gohman
f8754c2cf8 Fix warnings when the "wasm" feature is disabled. 2018-11-28 16:36:59 -08:00
Nick Fitzgerald
90756a8a01 clif-util: Default to reading input files from stdin
Fixes #495
2018-09-06 17:35:26 -07:00
Dan Gohman
f4dbd38a4c Rename Cretonne to Cranelift! 2018-07-13 09:15:16 -07:00
Benjamin Bouvier
26523fdf5c [clippy] Pass a few argument types by value, not by reference;
Since Location is basically just a usize, and wasmparser::Type is an
enum, and both are copiable, this passes them down by value instead of
by reference, as suggested by Clippy.
2018-07-10 06:11:30 -07:00
Dan Gohman
4a4453dc47 Use to_string() instead of format!("{}", ...). 2018-06-05 09:21:23 -07:00
Dan Gohman
4e67e08efd Use the target-lexicon crate.
This switches from a custom list of architectures to use the
target-lexicon crate.

 - "set is_64bit=1; isa x86" is replaced with "target x86_64", and
   similar for other architectures, and the `is_64bit` flag is removed
   entirely.

 - The `is_compressed` flag is removed too; it's no longer being used to
   control REX prefixes on x86-64, ARM and Thumb are separate
   architectures in target-lexicon, and we can figure out how to
   select RISC-V compressed encodings when we're ready.
2018-05-30 06:13:35 -07:00
Dan Gohman
94a883abae Make settings::Flags::new consume the Builder.
This makes it more clear what the relationship is between the Builder
and the resulting Flags.
2018-04-30 13:53:36 -07:00
Dan Gohman
24fa169e1f Rename the 'cretonne' crate to 'cretonne-codegen'.
This fixes the next part of #287.
2018-04-17 09:46:56 -07:00
Dan Gohman
7767186dd0 Rename 'cton_*' library names to match the 'cretonne_*' crate names.
This renames `cton_frontend` to `cretonne_frontend` and so on.

This fixes the first part of #287.
2018-04-17 07:55:59 -07:00
Dan Gohman
c50675deb8 Format with nightly rustfmt-preview, then with rustfmt-0.9 again. 2018-03-30 13:23:47 -07:00
Pat Hickey
03ee007624 Use clippy (#276)
* cton-util: fix some clippy unnecessary pass-by-value warnings

* clippy: ignore too many arguments / cyclomatic complexity in module

since these functions are taking args coming from the command line, i
dont think this is actually a valid lint, morally the arguments are all
from one structure

* cton-util: take care of remaining clippy warnings

* cton-reader: fix all non-suspicious clippy warnings

* cton-reader: disable clippy at site of suspicious lint

* cton-frontend: disable clippy at the site of an invalid lint

* cton-frontend: fix clippy warnings, or ignore benign ones

* clippy: ignore the camelcase word WebAssembly in docs

* cton-wasm: fix clippy complaints or ignore benign ones

* cton-wasm tests: fix clippy complaints

* cretonne: starting point turns off all clippy warnings

* cretonne: clippy fixes, or lower allow() to source of problem

* cretonne: more clippy fixes

* cretonne: fix or disable needless_lifetimes lint

this linter is buggy when the declared lifetime is used for another type
constraint.

* cretonne: fix clippy complaint about Pass::NoPass

* rustfmt

* fix prev minor api changes clippy suggested

* add clippy to test-all

* cton-filetests: clippy fixes

* simplify clippy reporting in test-all

* cretonne: document clippy allows better

* cretonne: fix some more clippy lints

* cretonne: fix clippy lints (mostly doc comments)

* cretonne: allow all needless_lifetimes clippy warnings

remove overrides at the false positives

* rustfmt
2018-03-22 13:10:41 -07:00
Dan Gohman
965b93bd2a Move the filetest harness into its own crate.
This allows us to run the tests via a library call rather than just
as a command execution. And, it's a step toward a broader goal, which
is to keep the code in the top-level src directory minimal, with
important functionality exposed as crates.
2018-03-15 15:35:48 -07:00
Dan Gohman
b6eae2cfb6 Put FlagsOrIsa in code-comments. 2017-10-25 10:11:36 -07:00
Dan Gohman
e4ef2cbf22 Support ISA-specific settings in the --isa command-line option. 2017-10-05 10:06:40 -07:00
Dan Gohman
ba14499fe9 Factor out the code for reading a file into a utility function. 2017-10-03 09:43:30 -07:00
Dan Gohman
f064418652 Refactor set/isa parsing into a utility function. 2017-10-03 09:43:27 -07:00
Dan Gohman
2efdc0ed37 Update rustfmt to 0.9.0. 2017-08-31 10:44:59 -07:00
Jakob Stoklund Olesen
69f974ba5d Add an ISA argument to dfg.display_inst().
Include ISA-specific annotations in tracing and error messages.
2017-07-12 10:13:13 -07:00
Jakob Stoklund Olesen
e4da2e1f22 Include ISA-specific information in verifier errors.
When the test driver reports a verifier error, make sure to include the
TargetIsa when printing the failing function.
2017-07-12 10:13:13 -07:00
Dan Gohman
ad9a942f52 Use write! in utility code, rather than calling write_function directly. 2017-05-11 06:57:55 -07:00
Jakob Stoklund Olesen
c5da572ebb Add a liveness verifier.
The liveness verifier will check that the live ranges are consistent
with the function. It runs as part of the register allocation pipeline
when enable_verifier is set.

The initial implementation checks the live ranges, but not the
ISA-specific constraints and affinities.
2017-04-21 16:01:08 -07:00
Jakob Stoklund Olesen
c4b794f7cf Run the verifier in the Context methods when it is enabled.
The test drivers can stop calling comp_ctx.verify because legalize() and
regalloc() do it themselves now.

This also makes it possible for those two passes to return other
CtonError codes in the future, not just verifier errors.
2017-04-21 12:36:35 -07:00
Jakob Stoklund Olesen
4c3e590bb9 Run verifier after legalizer and regalloc file tests.
Run the verify_contexti() function after invoking the legalize() and
regalloc() context functions. This will help catch bad code produced by
these passes.
2017-03-29 15:19:03 -07:00
rep-nop
b23f1fb347 Converts all try! macros to ? syntax.
Fixes #46
2017-02-26 07:50:55 -08:00
Jakob Stoklund Olesen
f9734458f8 Promote the src/tools crate to the top-level workspace.
The 'src' and 'tests' top-level directories now contain tools sources
and integration tests for any of the library crates.
2016-10-17 15:04:29 -07:00