mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 18:53:29 +00:00
Implement named binop types
This commit is contained in:
@@ -848,7 +848,11 @@ func (c *Compiler) parseBinOp(frame *Frame, binop *ssa.BinOp) (llvm.Value, error
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return llvm.Value{}, err
|
return llvm.Value{}, err
|
||||||
}
|
}
|
||||||
signed := binop.X.Type().(*types.Basic).Info() & types.IsUnsigned == 0
|
typ := binop.X.Type()
|
||||||
|
if typNamed, ok := typ.(*types.Named); ok {
|
||||||
|
typ = typNamed.Underlying()
|
||||||
|
}
|
||||||
|
signed := typ.(*types.Basic).Info() & types.IsUnsigned == 0
|
||||||
switch binop.Op {
|
switch binop.Op {
|
||||||
case token.ADD: // +
|
case token.ADD: // +
|
||||||
return c.builder.CreateAdd(x, y, ""), nil
|
return c.builder.CreateAdd(x, y, ""), nil
|
||||||
|
|||||||
Reference in New Issue
Block a user