* Update to rustfmt-preview.
* Run "cargo fmt --all" with rustfmt 0.4.1.
rustfmt 0.4.1 is the latest release of rustfmt-preview available on the
stable channel.
* Fix a long line that rustfmt 0.4.1 can't handle.
* Remove unneeded commas left behind by rustfmt.
* added wip translate_module fuzzer
* use local binaryen-rs fork (with shim) for fuzzing
* minor doc cleanup
* check fuzzer integration via CI
* switch back to upstream binaryen-rs; add forgotten integration test directive
It turns out that "cargo test --release" doesn't use
`[profile.release]`; it uses `[profile.bench]` instead; see
[here](https://doc.rust-lang.org/cargo/reference/manifest.html) for details.
So the plan to run the tests in optimized mode but with debug-assertions
enabled didn't actually work, and we had an actual failing unit test that
was hidden because assertions were disabled.
So, this makes test-all.sh just run the unit tests in debug mode, as is
the norm for Rust packages, and fixes the buggy test.
This also removes the `[profile.release]` override from the top-level
Cargo.toml file too. We don't need it now that we're not running tests
in release mode, and it had confused multiple people because it made
Cretonne's in-tree builds different from how Cretonne is built when used as
a dependency in other projects.
* 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
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.
Refactor the filetests harness so that it can be run as part of
`cargo test`. And begin reorganizing the test harness code in preparation
for moving it out of the src directory.
- Test subcommand files are now named `test_*.rs`.
- cton-util subcommand files now just export their `run` and nothing else.
- src/filetest/mod.rs now also just exports `run` and nothing else.
- Tests are now run in release mode (with debug assertions enabled).
Cretonne's python scripts aren't run very often, so there's little
benefit in creating .pyc files. And the .pyc files cause trouble for
some vendoring scripts. So disable them.
* API and data structures proposal for the SSA construction module
* Polished API and implemented trivial functions
* API more explicit, Variable now struct parameter
* Sample test written to see how the API could be used
* Implemented local value numbering for SSABuilder
* Implemented SSA within a single Ebb
* Unfinished unoptimized implementation for recursive use and seal
* Working global value numbering
The SSABuilder now create ebb args and modifies jump instructions accordingly
* Updated doc and improved branch argument modifying.
Removed instructions::branch_arguments and instructions::branch_argument_mut
* SSA building: bugfix, asserts and new test case
Missing a key optimization to remove cycles of Phi
* SSA Building: small changes after code review
Created helper function for seal_block (which now contains sanity checks)
* Optimization: removed useless phis (ebb arguments)
Using pessimistic assumption that when using a non-def variable in an unsealed block we create an ebb argument which is removed when sealing if we detect it as useless
Using aliases to avoid rewriting variables
* Changed the semantics of remove_ebb_arg and turned it into a proper API method
* Adapted ssa branch to changes in the DFG API
* Abandonned SparseMaps for EntityMaps, added named structure for headr block data.
* Created skeletton for a Cretonne IL builder frontend
* Frontend IL builder: first draft of implementation with example of instruction methods
* Working basic implementation of the frontend
Missing handling of function arguments and return values
* Interaction with function signature, sample test, more checks
* Test with function verifier, seal and fill sanity check
* Implemented python script to generate ILBuilder methods
* Added support for jump tables and stack slot
* Major API overhaul
* No longer generating rust through Python but implements InstBuilder
* No longer parametrized by user's blocks but use regular `Ebb`
* Reuse of allocated memory via distinction between ILBuilder and FunctionBuilder
* Integrate changes from StackSlot
* Improved error message
* Added support for jump arguments supplied by the user
* Added an ebb_args proxy method needed
* Adapted to Entity_ref splitted into a new module
* Better error messages and fixed tests
* Added method to change jump destination
* We whould be able to add unreachable code
* Added inst_result proxy to frontend
* Import support
* Added optimization for SSA construction:
If multiple predecessors but agree on value don't create EBB argument
* Move unsafe and not write-only funcs apart, improved doc
* Added proxy function for append_ebb_arg
* Support for unreachable code and better layout of the Ebbs
* Fixed a bug yielding an infinite loop in SSA construction
* SSA predecessors lookup code refactoring
* Fixed bug in unreachable definition
* New sanity check and display debug function
* Fixed bug in verifier and added is_pristine ;ethod for frontend
* Extended set of characters printable in function names
To be able to print names of functions in test suite
* Fixes and improvements of SSA construction after code review
* Bugfixes for frontend code simplification
* On-the-fly critical edge splitting in case of br_table with jump arguments
* No more dangling undefined values, now attached as EBB args
* Bugfix: only split corresponding edges on demand, not all br_table edges
* Added signature retrieval method
* Bugfix for critical edge splitting not sealing the ebbs it created
* Proper handling of SSA side effects by the frontend
* Code refactoring: moving frontend and SSA to new crate
* Frontend: small changes and bugfixes after code review
- Add a check-rustfmt.sh script which checks if the right version of
rustfmt is installed.
- Run check-rustfmt.sh --install as an install step under travis_wait.
This is to work around the issue where cargo takes forever to build
rustfmt, causing Travis to terminate the build because it hasn't
produced any output for 10 minutes.
Any *.cton files in the docs directory are now included when running the
test-all.sh script. This is to ensure that the examples are in fact
correct IL.
Always print NaN and Inf floats with a sign. Print the positive ones as
+NaN and +Inf to make them easier to parse.
Not all br_icmp opcodes are present in the ISA. The missing ones can be
reached by commuting operands.
Don't attempt to encode EBB offsets yet. For now just emit an EBB
relocation for the branch instruction.
Create a new directory hierarchy under 'filetests' for all the tests
that are run by 'cton-util test'.
Convert the parser tests under 'tests/parser' to use 'test cat' and
filecheck directives.
Rustfmt is still so immature that developers can't have different versions
installed, or there will be minute differences in formatting causing the tests
to fail.
Only run rustfmt as part of the test-all script if the expected version is
available.
The integration tests use both libcretonne and libreader, so moving them avoids
the circular dev-dependency.
Also go back to building everything under src/tools/target to avoid rebuilding
the libraries when cargo is invoked in different subdirectories. This speeds up
test-all.sh quite a bit.
Finally, skip the pure debug build. We build "cargo test" and "cargo build
--release" which should cover everything we need.
Move test-all.sh to the top level directory, and also run the parser tests from
this script.
Use a release build of cton-util to run the parser tests. As we accumulate many
tests in the tests directory tree, this will mean they can still be run quickly.
Point Travis config to the new test script.