Removed dead code
This commit is contained in:
parent
9a018f29e7
commit
ada7aaa1e2
14 changed files with 54 additions and 63 deletions
|
@ -13,20 +13,35 @@ import (
|
|||
// All call registers must hold the correct parameter values before the function invocation.
|
||||
// Registers that are in use must be saved if they are modified by the function.
|
||||
// After the function call, they must be restored in reverse order.
|
||||
func (f *Function) CompileCall(root *expression.Expression) ([]types.Type, error) {
|
||||
func (f *Function) CompileCall(root *expression.Expression) ([]*Parameter, error) {
|
||||
if root.Children[0].Token.Kind == token.Identifier {
|
||||
name := root.Children[0].Token.Text(f.File.Bytes)
|
||||
|
||||
switch name {
|
||||
case "len":
|
||||
return _len.OutputTypes, f.CompileLen(root)
|
||||
case "syscall":
|
||||
return nil, f.CompileSyscall(root)
|
||||
|
||||
case "len":
|
||||
output := []*Parameter{{
|
||||
name: "length",
|
||||
typ: types.AnyInt,
|
||||
}}
|
||||
|
||||
return output, f.CompileLen(root)
|
||||
|
||||
case "new":
|
||||
typ, err := f.CompileNew(root)
|
||||
return []types.Type{typ}, err
|
||||
|
||||
output := []*Parameter{{
|
||||
name: "address",
|
||||
typ: typ,
|
||||
}}
|
||||
|
||||
return output, err
|
||||
|
||||
case "delete":
|
||||
return nil, f.CompileDelete(root)
|
||||
|
||||
case "store":
|
||||
return nil, f.CompileMemoryStore(root)
|
||||
}
|
||||
|
@ -62,7 +77,7 @@ func (f *Function) CompileCall(root *expression.Expression) ([]types.Type, error
|
|||
f.BeforeCall()
|
||||
f.Label(asm.CALL, value.Label)
|
||||
f.AfterCall(registers)
|
||||
return fn.OutputTypes, nil
|
||||
return fn.Output, nil
|
||||
|
||||
case *eval.Register:
|
||||
err := f.ExpressionsToRegisters(parameters, registers, nil, true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue