mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-09 05:23:40 +00:00
Add -llvm-features parameter
With this is possible to enable e.g., SIMD in WASM using -llvm-features +simd128. Multiple features can be specified separated by comma, e.g., -llvm-features +simd128,+tail-call With help from @deadprogram and @aykevl.
This commit is contained in:
committed by
Ron Evans
parent
a0908ff55b
commit
617e2791ef
@@ -59,6 +59,7 @@ type Config struct {
|
||||
DefaultStackSize uint64
|
||||
NeedsStackObjects bool
|
||||
Debug bool // Whether to emit debug information in the LLVM module.
|
||||
LLVMFeatures string
|
||||
}
|
||||
|
||||
// compilerContext contains function-independent data that should still be
|
||||
@@ -185,7 +186,12 @@ func NewTargetMachine(config *Config) (llvm.TargetMachine, error) {
|
||||
if err != nil {
|
||||
return llvm.TargetMachine{}, err
|
||||
}
|
||||
features := strings.Join(config.Features, ",")
|
||||
|
||||
feat := config.Features
|
||||
if len(config.LLVMFeatures) > 0 {
|
||||
feat = append(feat, config.LLVMFeatures)
|
||||
}
|
||||
features := strings.Join(feat, ",")
|
||||
|
||||
var codeModel llvm.CodeModel
|
||||
var relocationModel llvm.RelocMode
|
||||
|
||||
Reference in New Issue
Block a user