Ayke van Laethem
174b6333f8
compiler: fix expanding zero-length structs
6 years ago
Ayke van Laethem
d8f0ddf3fa
main: add tests
Add testing infrastructure and one initial test (for
src/runtime/print.go). More tests to be added later.
6 years ago
Ayke van Laethem
ed227b8fd3
all: fix errors reported by go vet
6 years ago
Ayke van Laethem
a2eaaa42a0
main: optimize 'tinygo run'
Apparently -Oz without inliner is the fastest, probably because it
removes code that would otherwise need to be emitted.
TODO: does this mean that the ExecutionEngine compiles the module before
running it? Can we control this?
6 years ago
Ayke van Laethem
c9ae72a105
all: allow -O0 optimization level
6 years ago
Ayke van Laethem
6191d4e1ac
compiler: rename .Parse() to .Compiler()
The fact it was called Parse() is more of a historical accident, as the
compiler started out using the Go AST directly instead of Go SSA.
6 years ago
Ayke van Laethem
1b229a8f8b
compiler: support compiling individual .go files
For example:
tinygo run ./src/examples/test/test.go
6 years ago
Ayke van Laethem
a561e9a9ac
ir: move adding packages from the compiler
6 years ago
Ayke van Laethem
9df04a2170
compiler: fix panic on import errors
I think this is a problem in the loader package - it doesn't seem to
return errors for missing packages.
6 years ago
Ayke van Laethem
8a468786df
compiler: use config struct for options
6 years ago
Ayke van Laethem
ddd4a39cb8
avr: fix default handler in interrupt vector
Apparently the target of a weak symbol must be defined in the same file
as where it is used as a weak symbol.
https://www.avrfreaks.net/forum/using-weak-custom-vector-table#comment-745922
6 years ago
Ayke van Laethem
fd6dda5e4f
main: run the compiler from any path
6 years ago
Ayke van Laethem
453450f40d
ir: sort function pragmas
6 years ago
Ayke van Laethem
3076ad470e
tools/gen-device-svd: fix script filename in output
6 years ago
Ayke van Laethem
b09f7a5e6c
avr: make linker script generic
6 years ago
Ayke van Laethem
b9638315d2
avr: automatically generate interrupt vectors
6 years ago
Ayke van Laethem
3850530c88
docs/installation: fix LLVM hyperlink
6 years ago
Ayke van Laethem
3e1a60351d
docs/internals: fix hyperlink
6 years ago
Ayke van Laethem
7c597c910f
README: move installation instructions to docs
6 years ago
Ayke van Laethem
4868823dad
README: add docs badge
6 years ago
Ayke van Laethem
c9a2b3f417
docs: remove "Indices and tables"
6 years ago
Ayke van Laethem
f7f33a1163
docs: add initial documentation
6 years ago
Ayke van Laethem
2938437efc
compiler: make string data unnamed addresses
This ensures LLVM can merge identical strings, and thus reduces code
size in some cases.
6 years ago
Ayke van Laethem
7cea40bcb5
compiler: small cleanup in call handling code
6 years ago
Ayke van Laethem
fdfa810060
compiler: expand small structs
Use fields of small structs (3 or less fields when flattened
recursively) directly as parameter values.
Advantages:
* Code size is slightly reduced, both on unix and nrf.
* AVR can finally deal with struct parameters - at least the small
ones. examples/test now compiles. A real fix for struct parameters
should go into upstream LLVM, but this is a nice win.
fixes #20
6 years ago
Ayke van Laethem
a86739d235
Makefile: add new packages to tgo dependencies
6 years ago
Ayke van Laethem
b2cbfa78ca
compiler: refactor compiler into separate package
6 years ago
Ayke van Laethem
b75a02e66d
compiler: refactor IR parts into separate package
6 years ago
Ayke van Laethem
473e71b573
compiler: implement range over a string
6 years ago
Ayke van Laethem
18b5ab290c
compiler: recognize untyped strings as strings
6 years ago
Ayke van Laethem
c8587c7d1e
Makefile: go fmt more packages
6 years ago
Ayke van Laethem
4d5b5241ec
all: avoid _Msk fields when not necessary
6 years ago
Ayke van Laethem
eadec6f766
tools/gen-device-svd: avoid _Msk for single-bit fields
6 years ago
Ayke van Laethem
3bba26ce5b
machine/bluepill: create definitions for all pins
6 years ago
Ayke van Laethem
8f5bd81bf5
machine: split board definitions in separate files
6 years ago
Ayke van Laethem
2c21925f4c
targets: put board name in build tags
6 years ago
Ron Evans
9df7d6e8e8
examples: add nrf example for all 4 built-in buttons and LEDs
Signed-off-by: Ron Evans <ron@hybridgroup.com>
6 years ago
Ayke van Laethem
a577bc2a1b
tools/gen-device-svd: show better error messages
Show an error message when input .svd files cannot be found.
6 years ago
Ayke van Laethem
dd5b5a381c
stm32: initial support
6 years ago
Ayke van Laethem
12298d23a7
all: move generic ARM bits into separate files
6 years ago
Ayke van Laethem
895d109fc4
compiler: run flash command in a shell
6 years ago
Ayke van Laethem
7517ac86e4
runtime: merge common sleep() functions
6 years ago
Ayke van Laethem
7c16f6c904
tools/gen-device-svd: make source URL configurable
6 years ago
Ayke van Laethem
b705b332a7
tools/gen-device-svd: indentation in .s file
6 years ago
Ayke van Laethem
e0d13f489f
tools/gen-device/svd: auto-generate output directory
6 years ago
Ayke van Laethem
d841daa32b
tools/gen-device-svd: emit correct Go code for stm32
Groups were not recognized because the parser only looked at the
derivedFrom attribute and not at <groupName> tags for matching
peripherals.
6 years ago
Ayke van Laethem
9fa08bf51d
all: use groupName in peripherals
This is needed for support for multiple instances of a peripheral type.
6 years ago
Ayke van Laethem
110230a50d
tools/gen-device-svd: make svd files deal with stm32
First concrete preparation for stm32 support at some point.
6 years ago
Ayke van Laethem
5b0aaf0d39
targets: clean up and unify linker scripts
Especially arm.ld needed some cleaning up. Other than that, I've made
sure the two linker scripts look similar where possible.
6 years ago
Ayke van Laethem
2122780309
compiler: implement *ssa.ChangeType
6 years ago