Ayke van Laethem
70871c98f8
Improve print functions
6 years ago
Ayke van Laethem
62c4c5e90b
go fmt
6 years ago
Ayke van Laethem
a97ca91c1f
compiler: Implement interface calls
This is a big combined change. Other changes in this commit:
* Analyze makeinterface and make sure type switches don't include
unnecessary cases.
* Do not include CGo wrapper functions in the analyzer callgraph.
This also avoids some unnecessary type IDs.
* Give all Go named structs a name in LLVM.
* Use such a named struct for compiler-generated task data.
* Use the type and function names defined by the ssa and types
package instead of generating our own.
* Some improvements to function pointers.
* A few other minor improvements.
The one thing lacking here is interface-to-interface assertions.
7 years ago
Ayke van Laethem
90fb0ee4eb
Add AVR support
This requires support in LLVM, as AVR support is still experimental. For
example, in bindings/go/build.sh, add
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=AVR to cmake_flags.
7 years ago
Ayke van Laethem
802302a1aa
Add support for inline assembly
This depends on support in LLVM, which hasn't been merged yet.
See: https://reviews.llvm.org/D46437
7 years ago
Ayke van Laethem
0168bf7797
Add goroutines and function pointers
7 years ago
Ayke van Laethem
b4e60deacd
runtime/nrf: Fix allocator by adding align() function
7 years ago
Ayke van Laethem
588910792d
Translate bootstrapping main from C to LLVM IR
This avoids needing a C compiler for every platform.
7 years ago
Ayke van Laethem
89f77fa861
machine/dummy: Add LED1, LED2, etc to dummy machine
7 years ago
Ayke van Laethem
320c583221
Implement printing of int8/uint8/pointers
7 years ago
Ayke van Laethem
e171f32493
Implement minimal bump pointer allocator
Useful for MCUs, until a real garbage collector has been implemented.
7 years ago
Ayke van Laethem
a39951c3d7
runtime: Convert device initialization to Go
7 years ago
Ayke van Laethem
c4f0dc90dd
machine: Rewrite most of the GPIO functionality
Split across device types (nrf, dummy) and use registers directly
instead of the HAL.
7 years ago
Ayke van Laethem
8c426b406d
Automatically convert .svd files to Go source files
7 years ago
Ayke van Laethem
3a4663150e
runtime: Implement GPIO output
Now we can actually blink a LED!
7 years ago
Ayke van Laethem
d4170faa0a
runtime/nrf: Add Sleep()
7 years ago
Ayke van Laethem
4491a63fe8
Add print() for 64-bit integers
7 years ago
Ayke van Laethem
c940617849
compiler: Implement init()
7 years ago
Ayke van Laethem
2d19bb11ba
compiler: Merge the runtime into the Go code, for better code size
7 years ago
Ayke van Laethem
10427c2b6f
Add blinky example (which doesn't blink a LED, yet)
7 years ago
Ayke van Laethem
04fef19753
Add runtime support for the nRF52
7 years ago
Ayke van Laethem
ea129f3072
Implement runtime.Sleep
7 years ago
Ayke van Laethem
5067891236
Implement unsigned integers
7 years ago
Ayke van Laethem
75fce0f949
runtime: Move print functions to separate file
7 years ago
Ayke van Laethem
cf9cea7a0d
Implement array bounds check
7 years ago
Ayke van Laethem
1f0651c84c
Implement string out of bounds checks
7 years ago
Ayke van Laethem
db66039dfe
Implement panic()
7 years ago
Ayke van Laethem
217c48f933
Implement interfaces on the string type
7 years ago
Ayke van Laethem
45e7376f39
Implement print() and println() in Go
7 years ago
Ayke van Laethem
ff9e7a8b77
Implement CGo support
This mostly works around the default CGo support: this compiler doesn't
need special wrappers for C functions as it uses the C calling
convention by default.
7 years ago
Ayke van Laethem
3e3c3d259f
Add rudimentary interface support
7 years ago
Ayke van Laethem
850fef9852
Add builtin len(string)
7 years ago
Ayke van Laethem
013b375904
Add type methods
7 years ago
Ayke van Laethem
139ac45cb1
Use only putchar() for printing
7 years ago
Ayke van Laethem
d555ad93d7
Add support for structs
7 years ago
Ayke van Laethem
5dfcb5f085
Reorganize packages
7 years ago