Ayke van Laethem
a3d1f1a514
all: try more locations to find Clang built-in headers
...
This commit fixes the case where TinyGo was built with `go build` and
LLVM sources were never downloaded into the TinyGo source directory.
2019-06-13 15:21:04 +02:00
Tomer Elmalem
3e1c0d90c5
Add implementation for os.Exit and syscall.Exit
2019-06-12 19:04:34 +02:00
Ayke van Laethem
b7197bcaae
compiler,runtime: implement non-blocking selects
...
Blocking selects are much more complicated, so let's do non-blocking
ones first.
2019-06-12 18:26:52 +02:00
Ayke van Laethem
8890a0f3c8
compiler,runtime: store channel size in the channel itself
...
This may have a small effect on code size sometimes, but will simplify
the implementation of the select statement.
2019-06-12 18:26:52 +02:00
Justin Clift
5be412dabe
Makefile: using an alternative LLVM build dir now works
2019-06-12 14:05:45 +02:00
Ayke van Laethem
412ec5b789
Makefile: drop the -lclangToolingRefactor library
...
It is not necessary and does not exist in LLVM 9.
2019-06-12 08:43:08 +02:00
Ayke van Laethem
b0e767c4a7
compiler: move global handling from ir to compiler package
...
This is part of a larger rafactor that tries to shrink the ir package
and in general tries to shrink the amount of state that is kept around
in the compiler. The end goal is being able to compile packages
independent of each other, linking them together in a later stage. Along
the way, it cleans up lots of old cruft that has accumulated over the
months.
This refactor also results in globals being loaded lazily. This may be a
problem for some specific programs but will probably change back in a
commit in the near future.
2019-06-08 22:17:09 +02:00
Ayke van Laethem
6b5b4a681d
compiler: refactor named types to create them lazily
...
This commit refactors named types to be created lazily. Instead of
defining all types in advance, do it only when necessary.
2019-06-08 22:17:09 +02:00
Ayke van Laethem
88bb61f287
compiler: return a valid (undef) value from a unsupported select
...
Returning a nil value may lead to problems later on. Just return undef
here, so that further compilation will at least be safe (the result
will be discarded anyway).
2019-06-08 21:48:05 +02:00
Ayke van Laethem
e169e3b996
compiler: remove superfluous 'err' result in decodeFuncValue
2019-06-08 21:48:05 +02:00
Ayke van Laethem
aa8957dd05
compiler: support non-constant syscall numbers
...
Not all syscalls use constant numbers.
2019-06-08 21:48:05 +02:00
Ayke van Laethem
8e5731aee7
compiler: add support for pointers as map keys
2019-06-08 21:48:05 +02:00
Justin Clift
0cc35b6188
Add a note to use --recursive when cloning the TinyGo repo
2019-06-08 22:50:14 +10:00
Ayke van Laethem
5cf7fba1a4
compiler: remove //go:volatile support
2019-06-06 19:46:49 +02:00
Ayke van Laethem
e67506ee68
arm: update to avoid //go:volatile
...
This change results in changes to all smoketests for Cortex-M based
chips: they get a bit smaller (32-48 bytes). I'm not sure why but
probably because the inliner made a different inlining decision. There
was a similar effect when files generated from SVD files switched to the
new volatile types so it's probably harmless.
2019-06-06 19:46:49 +02:00
Ayke van Laethem
f2c205a008
machine: update ringbuffer to use runtime/volatile.Register8
...
This avoids the //go:volatile pragma, which will be removed soon.
There were no changes to the output of the smoke tests.
2019-06-06 19:46:49 +02:00
Ayke van Laethem
c84c625585
runtime: update to avoid //go:volatile
...
There was exactly one change in the output of the smoke tests:
examples/test. However, it still runs just fine on a PCA10040.
2019-06-06 19:46:49 +02:00
Ayke van Laethem
9673ad3774
all: move Register{8,16,32} values into runtime/volatile
...
This avoids duplication of code. None of the smoke tests have changed
their output.
2019-06-06 19:46:49 +02:00
Ayke van Laethem
66aca428ba
compiler: rename import path if it lies in TINYGOPATH
...
This allows importing (for example) both
"github.com/tinygo-org/tinygo/src/machine" and "machine" without issues.
The former is renamed to just "machine".
2019-06-06 16:01:25 +02:00
Ayke van Laethem
ec87811420
compiler: do not panic on duplicate functions
...
Instead, show a regular error message. This is much more user-friendly.
2019-06-06 16:01:25 +02:00
Ayke van Laethem
776dc1e0d9
main: show a better error when version detection of GOROOT failed
2019-06-06 13:59:37 +02:00
Ron Evans
beea2f1f30
docs: add note to current/future contributors to please start by opening a GH issue to avoid duplication of effort
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-06-06 12:09:17 +02:00
Ayke van Laethem
5f9c683abf
main: return an error when running a command failed
2019-06-05 09:08:44 +02:00
Ayke van Laethem
0ce4d90779
cgo: add support for anonymous structs
2019-06-03 20:01:47 +02:00
Tomer Elmalem
1047c9bd05
reflect: stub out reflect.New and reflect.Zero
2019-06-03 19:26:47 +02:00
Ayke van Laethem
1d7cc2c242
cgo: add support for bitfields using generated getters and setters
2019-06-03 16:13:19 +02:00
Ayke van Laethem
23c8d15847
main: add -dev suffix to version
2019-06-03 16:09:29 +02:00
Ayke van Laethem
da85710894
main: version 0.6.0
2019-05-29 16:38:04 +02:00
j7b
0ae467d3e2
llvm cpu features
2019-05-28 15:41:34 +02:00
Justin Clift
4442b1304e
Trivial typo fix
2019-05-28 09:55:35 +02:00
Ayke van Laethem
83ab61e261
ci: install Go 1.12.5 on macOS
...
This should fix compatibility with the Go 1.12 stdlib:
https://github.com/tinygo-org/tinygo/issues/368
2019-05-27 19:47:12 +02:00
Ron Evans
2504754325
machine/samd21: use HasBits() method to simplify bit comparisons
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-05-27 18:43:11 +02:00
Ron Evans
be491abc46
machine/stm32: use HasBits() method to simplify bit comparisons
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-05-27 18:43:11 +02:00
Ron Evans
31189deb3b
machine/avr: use HasBits() method to simplify bit comparisons
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-05-27 18:43:11 +02:00
Ron Evans
90cd3f8ea5
tools: generate volatile HasBits() method in device wrappers to simplify bit comparison code
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-05-27 18:43:11 +02:00
Ayke van Laethem
2f95a5d452
ci: use go modules instead of dep
...
This also updates the LLVM build to include this commit:
d519e424c5
2019-05-27 18:42:36 +02:00
Ayke van Laethem
eb1d834dd4
wasm: add support for js.FuncOf
2019-05-27 13:35:59 +02:00
Ayke van Laethem
3313decb68
compiler,runtime: make panic functions camelCase
...
Rename panic functions to be runtime.nilPanic, runtime.lookupPanic, and
runtime.slicePanic.
2019-05-27 13:35:59 +02:00
Ron Evans
191a076956
docs: update list of supported MCU boards
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-05-27 09:43:24 +02:00
Ayke van Laethem
0f2dcba7b3
syscall: implement Exit call on unix
2019-05-27 07:50:13 +02:00
Ayke van Laethem
94b8214529
machine: refactor pins to be of Pin type
2019-05-26 20:48:50 +02:00
Ayke van Laethem
421ef04efb
wasm: fix Makefile to avoid debuginfo
2019-05-25 18:40:56 +02:00
Ayke van Laethem
f7687c43aa
wasm: fix wasm-ld hang
...
See the following bugs for more information:
https://bugs.llvm.org/show_bug.cgi?id=41508
https://bugs.llvm.org/show_bug.cgi?id=37064
2019-05-25 18:25:46 +02:00
Ayke van Laethem
5a7bab8808
main: add the absolute path to clang-8 on macOS
...
This avoids the need to correctly set $PATH if LLVM 8 has been installed
using Homebrew.
2019-05-24 19:53:43 +02:00
Ron Evans
3a73e64557
tools/gen-device: complete refactor to new generator based on volatile package
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-05-24 16:28:47 +02:00
Ron Evans
9f8340a970
machine/nrf: refactor to use volatile package/API
...
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-05-24 15:44:33 +02:00
k-brk
0f6873cf02
machine/stm32f103xx: fix i2c 2 byte read
2019-05-24 15:26:06 +02:00
Ayke van Laethem
f2cd4d12e8
compiler,runtime: fix multiple definitions of a single function
...
strings.IndexByte was implemented in the runtime up to Go 1.11. It is
implemented using a direct call to internal/bytealg.IndexByte since Go
1.12.
Make sure we remain compatible with both.
2019-05-24 14:51:40 +02:00
Ayke van Laethem
7e6a54ac62
main: add build tags for the Go stdlib version
2019-05-24 14:51:40 +02:00
Ayke van Laethem
7156afca9e
interp: support some more expressions in const icmp
2019-05-24 14:00:23 +02:00