diff options
Diffstat (limited to 'compiler/compiler.go')
-rw-r--r-- | compiler/compiler.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/compiler.go b/compiler/compiler.go index 436544d82..bb2ddc61e 100644 --- a/compiler/compiler.go +++ b/compiler/compiler.go @@ -3114,9 +3114,11 @@ func (c *Compiler) NonConstGlobals() { } } -// Replace i64 in an external function with a stack-allocated i64*, to work +// When -wasm-abi flag set to "js" (default), +// replace i64 in an external function with a stack-allocated i64*, to work // around the lack of 64-bit integers in JavaScript (commonly used together with // WebAssembly). Once that's resolved, this pass may be avoided. +// See also the -wasm-abi= flag // https://github.com/WebAssembly/design/issues/1172 func (c *Compiler) ExternalInt64AsPtr() error { int64Type := c.ctx.Int64Type() @@ -3220,7 +3222,8 @@ func (c *Compiler) ExternalInt64AsPtr() error { c.builder.SetInsertPointAtEnd(entryBlock) var callParams []llvm.Value if fnType.ReturnType() == int64Type { - return errors.New("todo: i64 return value in exported function") + return errors.New("not yet implemented: exported function returns i64 with -wasm-abi=js; " + + "see https://tinygo.org/compiler-internals/calling-convention/") } for i, origParam := range fn.Params() { paramValue := externalFn.Param(i) |