time.Sleep now compiles on all systems, so lets use that.
Additionally, do a few improvements in time unit handling for the
scheduler. This should lead to somewhat longer sleep durations without
wrapping (on some platforms).
Some examples got smaller, some got bigger. In particular, code using
the scheduler got bigger and the blinky1 example got smaller (especially
on Arduino: 380 -> 314 bytes).
These calls are generated in the JavaScript target (syscall/js and
syscall with GOOS=js), but they are not used at the moment. So ignore
them until they're needed.
The unreachable instruction is actually a block terminator so may only
be inserted at the end of a basic block. This is not always the case for
type asserts, so don't insert this instruction.
LLVM will hopefully optimize it anyway when it realizes anything after
the panic() call is unreachable.
This is kind of dirty with that huge list of linker params, but it works
and it produces smaller object files (probably because GCC is better
optimized for size).
This increases code size on the nrf, but it is a fixed increase and can
hopefully be reduced in the future.
The Makefile gets a lot smaller with this which is a huge advantage
(less build time complexity).
This is the last critical part of the C runtime.
Code size is reduced by 4 bytes for examples/blinky2 (probably due to
inlining) and is unchanged for examples/test.
To get more compatibility with the go command, implement a similar
command line interface (with "tinygo build <package>" etc.).
Other than that, an all-round cleanup of command parsing.
This specifically fixes unix alloc(): previously when allocation fails
it would (recursively) call alloc() again to create an interface due to
lacking escape analysis.
Also, all other cases shouldn't try to allocate just because something
bad happens at runtime.
TODO: implement escape analysis.
Because a few things were left unimplemented it only happened to kind-of
work before in my test cases.
This commit should complete interface-to-interface type asserts.
Add 'optimized-out' parameters to functions. This might make debugging
slightly easier by showing parameter names.
Sadly I din't get setting variables to work. It might be a bug in
CreateExpression.