From 8c139dcb686df878333429c4eb7a87b768639d40 Mon Sep 17 00:00:00 2001 From: Markku Rossi Date: Mon, 5 Aug 2024 06:33:33 +0200 Subject: [PATCH] Removed dead code. --- compiler/ast/ssagen.go | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/compiler/ast/ssagen.go b/compiler/ast/ssagen.go index 4fba5b9..ea28e2c 100644 --- a/compiler/ast/ssagen.go +++ b/compiler/ast/ssagen.go @@ -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" ) @@ -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) {