compileInstrOrValue

This commit is contained in:
xushiwei
2024-04-29 18:46:13 +08:00
parent e1d1d6a2d9
commit 664c3fcce3

View File

@@ -335,9 +335,12 @@ func (p *context) compileInstrOrValue(b llssa.Builder, iv instrOrValue, asValue
panic("todo") panic("todo")
} }
default: default:
panic("todo")
/*
fn := p.compileValue(b, cv) fn := p.compileValue(b, cv)
args := p.compileValues(b, call.Args, kind) args := p.compileValues(b, call.Args, kind)
ret = b.Call(fn, args...) ret = b.Call(fn, args...)
*/
} }
case *ssa.BinOp: case *ssa.BinOp:
x := p.compileValue(b, v.X) x := p.compileValue(b, v.X)
@@ -458,11 +461,14 @@ func (p *context) compileValue(b llssa.Builder, v ssa.Value) llssa.Expr {
} }
} }
case *ssa.Function: case *ssa.Function:
panic("unreachable")
/*
fn, ftype := p.funcOf(v) fn, ftype := p.funcOf(v)
if ftype >= llgoInstrBase { if ftype >= llgoInstrBase {
panic("can't use llgo instruction as a value") panic("can't use llgo instruction as a value")
} }
return fn.Expr return fn.Expr
*/
case *ssa.Global: case *ssa.Global:
g := p.varOf(v) g := p.varOf(v)
return g.Expr return g.Expr