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.
5 years ago
Justin Clift
5be412dabe
Makefile: using an alternative LLVM build dir now works
6 years ago
Ayke van Laethem
412ec5b789
Makefile: drop the -lclangToolingRefactor library
It is not necessary and does not exist in LLVM 9.
5 years ago
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.
5 years ago
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.
5 years ago
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).
5 years ago
Ayke van Laethem
e169e3b996
compiler: remove superfluous 'err' result in decodeFuncValue
5 years ago
Ayke van Laethem
aa8957dd05
compiler: support non-constant syscall numbers
Not all syscalls use constant numbers.
5 years ago
Ayke van Laethem
8e5731aee7
compiler: add support for pointers as map keys
5 years ago
Justin Clift
0cc35b6188
Add a note to use --recursive when cloning the TinyGo repo
5 years ago
Ayke van Laethem
5cf7fba1a4
compiler: remove //go:volatile support
6 years ago
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.
6 years ago
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.
6 years ago
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.
6 years ago
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.
6 years ago
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".
6 years ago
Ayke van Laethem
ec87811420
compiler: do not panic on duplicate functions
Instead, show a regular error message. This is much more user-friendly.
6 years ago
Ayke van Laethem
776dc1e0d9
main: show a better error when version detection of GOROOT failed
6 years ago
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>
6 years ago
Ayke van Laethem
5f9c683abf
main: return an error when running a command failed
6 years ago
Ayke van Laethem
0ce4d90779
cgo: add support for anonymous structs
6 years ago
Tomer Elmalem
1047c9bd05
reflect: stub out reflect.New and reflect.Zero
6 years ago
Ayke van Laethem
1d7cc2c242
cgo: add support for bitfields using generated getters and setters
6 years ago
Ayke van Laethem
23c8d15847
main: add -dev suffix to version
6 years ago
Ayke van Laethem
da85710894
main: version 0.6.0
6 years ago
j7b
0ae467d3e2
llvm cpu features
6 years ago
Justin Clift
4442b1304e
Trivial typo fix
6 years ago
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
6 years ago
Ron Evans
2504754325
machine/samd21: use HasBits() method to simplify bit comparisons
Signed-off-by: Ron Evans <ron@hybridgroup.com>
6 years ago
Ron Evans
be491abc46
machine/stm32: use HasBits() method to simplify bit comparisons
Signed-off-by: Ron Evans <ron@hybridgroup.com>
6 years ago
Ron Evans
31189deb3b
machine/avr: use HasBits() method to simplify bit comparisons
Signed-off-by: Ron Evans <ron@hybridgroup.com>
6 years ago
Ron Evans
90cd3f8ea5
tools: generate volatile HasBits() method in device wrappers to simplify bit comparison code
Signed-off-by: Ron Evans <ron@hybridgroup.com>
6 years ago
Ayke van Laethem
2f95a5d452
ci: use go modules instead of dep
This also updates the LLVM build to include this commit:
d519e424c5
6 years ago
Ayke van Laethem
eb1d834dd4
wasm: add support for js.FuncOf
6 years ago
Ayke van Laethem
3313decb68
compiler,runtime: make panic functions camelCase
Rename panic functions to be runtime.nilPanic, runtime.lookupPanic, and
runtime.slicePanic.
6 years ago
Ron Evans
191a076956
docs: update list of supported MCU boards
Signed-off-by: Ron Evans <ron@hybridgroup.com>
6 years ago
Ayke van Laethem
0f2dcba7b3
syscall: implement Exit call on unix
6 years ago
Ayke van Laethem
94b8214529
machine: refactor pins to be of Pin type
6 years ago
Ayke van Laethem
421ef04efb
wasm: fix Makefile to avoid debuginfo
6 years ago
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
6 years ago
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.
6 years ago
Ron Evans
3a73e64557
tools/gen-device: complete refactor to new generator based on volatile package
Signed-off-by: Ron Evans <ron@hybridgroup.com>
6 years ago
Ron Evans
9f8340a970
machine/nrf: refactor to use volatile package/API
Signed-off-by: Ron Evans <ron@hybridgroup.com>
6 years ago
k-brk
0f6873cf02
machine/stm32f103xx: fix i2c 2 byte read
6 years ago
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.
6 years ago
Ayke van Laethem
7e6a54ac62
main: add build tags for the Go stdlib version
6 years ago
Ayke van Laethem
7156afca9e
interp: support some more expressions in const icmp
6 years ago
Ayke van Laethem
87ac804642
ci: make sure that all examples are included in the smoketests
6 years ago
Ayke van Laethem
edcb11f9f6
ci: move tests from CircleCI config to Makefile
This makes it easier to run smoke tests locally.
6 years ago
Ayke van Laethem
3568254593
machine/atsamd21: fix analog pin mode
6 years ago