all: add WebAssembly backend

This commit is contained in:
Ayke van Laethem
2018-10-18 15:15:29 +02:00
parent a51e04c550
commit e5e09747f0
15 changed files with 199 additions and 17 deletions
+7 -1
View File
@@ -7,6 +7,8 @@ import (
"path/filepath"
"runtime"
"strings"
"github.com/aykevl/go-llvm"
)
// Target specification for a given target. Used for bare metal targets.
@@ -30,6 +32,10 @@ type TargetSpec struct {
// Load a target specification
func LoadTarget(target string) (*TargetSpec, error) {
if target == "" {
target = llvm.DefaultTargetTriple()
}
spec := &TargetSpec{
Triple: target,
BuildTags: []string{runtime.GOOS, runtime.GOARCH},
@@ -54,7 +60,7 @@ func LoadTarget(target string) (*TargetSpec, error) {
// Expected a 'file not found' error, got something else.
return nil, err
} else {
// No target spec available. This is fine.
// No target spec available. Use the default one.
}
return spec, nil