mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-13 07:23:39 +00:00
compiler: implement syscall.Syscall* as builtins
Treating them as builtins is easier to implement and likely reduces code size.
This commit is contained in:
committed by
Ron Evans
parent
6ae4b43eb2
commit
f7b2a2c977
@@ -1686,6 +1686,11 @@ func (c *Compiler) parseCall(frame *Frame, instr *ssa.CallCommon) (llvm.Value, e
|
||||
return c.builder.CreateCall(target, args, ""), nil
|
||||
}
|
||||
|
||||
switch fn.RelString(nil) {
|
||||
case "syscall.Syscall", "syscall.Syscall6":
|
||||
return c.emitSyscall(frame, instr)
|
||||
}
|
||||
|
||||
targetFunc := c.ir.GetFunction(fn)
|
||||
if targetFunc.LLVMFn.IsNil() {
|
||||
return llvm.Value{}, c.makeError(instr.Pos(), "undefined function: "+targetFunc.LinkName())
|
||||
|
||||
Reference in New Issue
Block a user