mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-12 06:53:40 +00:00
all: add flag to enable i64 parameters in WebAssembly
This commit is contained in:
committed by
Ayke van Laethem
parent
dccfae485c
commit
a8dd82538e
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user