Skip to content

Commit

Permalink
Removed dead code.
Browse files Browse the repository at this point in the history
  • Loading branch information
markkurossi committed Aug 5, 2024
1 parent 9894752 commit 8c139dc
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions compiler/ast/ssagen.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"slices"

"github.com/markkurossi/mpc/compiler/ssa"
"github.com/markkurossi/mpc/compiler/utils"
"github.com/markkurossi/mpc/types"
"github.com/markkurossi/tabulate"
)
Expand Down Expand Up @@ -1834,27 +1833,6 @@ func (ast *Unary) addrIndex(block *ssa.Block, ctx *Codegen, gen *ssa.Generator,
return lrv, ptrType.ElementType, offset + ival*ptrType.ElementType.Bits, nil
}

func lookupElement(ctx *Codegen, loc utils.Locator, t types.Info, name string) (
types.Info, types.Size, error) {

switch t.Type {
case types.TStruct:
var offset types.Size
for _, field := range t.Struct {
if field.Name == name {
return field.Type, offset, nil
}
offset += field.Type.Bits
}
return types.Undefined, 0, ctx.Errorf(loc,
"%s undefined (%s has no field of method %s)", name, t, name)

default:
return types.Undefined, 0, ctx.Errorf(loc,
"%s undefined (%s has no field of method %s)", name, t, name)
}
}

// SSA implements the compiler.ast.AST.SSA for slice expressions.
func (ast *Slice) SSA(block *ssa.Block, ctx *Codegen, gen *ssa.Generator) (
*ssa.Block, []ssa.Value, error) {
Expand Down

0 comments on commit 8c139dc

Please sign in to comment.