Add goroutines and function pointers

This commit is contained in:
Ayke van Laethem
2018-06-07 14:48:24 +02:00
parent 8df220a53b
commit 0168bf7797
10 changed files with 796 additions and 59 deletions
+8 -2
View File
@@ -10,6 +10,7 @@ LLVM := $(shell go env GOPATH)/src/github.com/aykevl/llvm/bindings/go/llvm/workd
LINK = $(LLVM)llvm-link
LLC = $(LLVM)llc
LLAS = $(LLVM)llvm-as
OPT = $(LLVM)opt
CFLAGS = -Wall -Werror -Os -g -fno-exceptions -flto -ffunction-sections -fdata-sections $(LLFLAGS)
@@ -72,10 +73,15 @@ build/tgo: *.go
@mkdir -p build
go build -o build/tgo -i .
# Build textual IR with the Go compiler.
build/%.o: src/examples/% src/examples/%/*.go build/tgo src/runtime/*.go build/runtime-$(TARGET)-combined.bc
# Build IR with the Go compiler.
build/%.bc: src/examples/% src/examples/%/*.go build/tgo src/runtime/*.go build/runtime-$(TARGET)-combined.bc
./build/tgo $(TGOFLAGS) -printir -runtime build/runtime-$(TARGET)-combined.bc -o $@ $(subst src/,,$<)
# Compile and optimize bitcode file.
build/%.o: build/%.bc
$(OPT) -coro-early -coro-split -coro-elide -O1 -coro-cleanup -o $< $<
$(LLC) -filetype=obj -o $@ $<
# Compile C sources for the runtime.
build/%.bc: src/runtime/%.c src/runtime/*.h
@mkdir -p build