Because of the way that the `pass` subcommand orders its arguments, the
positional "single-file" input cannot be optional with a default value, because
it is followed by required positional arguments. If it were optional, that would
result in argument ambiguity where `clap` cannot tell if the optional positional
argument is supplied, or if the given argument is the next required positional
argument.
Before this commit:
```
$ cargo run --bin clif-util -- pass ./filetests/dce/basic.clif dce
Compiling cranelift-tools v0.21.0 (file:///Users/fitzgen/src/cranelift)
Finished dev [unoptimized + debuginfo] target(s) in 4.38s
Running `target/debug/clif-util pass ./filetests/dce/basic.clif dce`
thread 'main' panicked at 'Found positional argument which is not required with a lower index than a required positional argument: "single-file" index 1', /Users/fitzgen/.cargo/registry/src/github.com-1ecc6299db9ec823/clap-2.32.0/src/app/parser.rs:612:21
note: Run with `RUST_BACKTRACE=1` for a backtrace.
```
After this commit:
```
$ cargo run --bin clif-util -- pass ./filetests/dce/basic.clif dce
Compiling cranelift-filetests v0.21.0 (file:///Users/fitzgen/src/cranelift/lib/filetests)
Compiling cranelift-tools v0.21.0 (file:///Users/fitzgen/src/cranelift)
Finished dev [unoptimized + debuginfo] target(s) in 5.96s
Running `target/debug/clif-util pass ./filetests/dce/basic.clif dce`
1 tests
```
* Reorganize the global value kinds.
This:
- renames "deref" global values to "load" and gives it a offset that works
like the "load" instructions' does
- adds an explicit "iadd_imm" global value kind, which replaces the
builtin iadd in "vmctx" and "deref" global values.
- also renames "globalsym" to "symbol"
This makes several changes:
- It adds an index_type to heap declarations, allowing heaps to specify the
type for indexing. This also anticipates 64-bit heap support.
- It adds a memory_type to deref global values, allowing deref globals to
have types other than pointers. This is used to allow the bound variable
in dynamic heaps to have type i32, to match the index type in heaps
with i32 index type.
- And, it fixes heap legalization to do the bounds check in the heap's
index type.
* fix error not reported if at least one other error expected.
* Fixed unused extern crate error if wasm feature is not enabled.
* No longer reporting deref cycles multiple times.
* Fix filetest type_check.clif.
* Switched comparison order for perf.
* Fixed isa/riscv/verify-encoding.clif filetest.
* Fixed error reporting.
* Fixed compile time error when wasm feature is disabled.
* Fixed valid instructions not being printed in print_function_error.
* Fixed errors print_function_error not writing valid instructions after end.
* Made multiple checks non-fatal.
* verify_global_values is no longer fatal.
* Slightly better formatting of errors in pretty_verifier_error.