From 3344f9de510eb647ea622fc959a12d1031e8e4d6 Mon Sep 17 00:00:00 2001 From: xgopilot Date: Wed, 29 Oct 2025 03:46:55 +0000 Subject: [PATCH] refactor(ssa): rename namedIntf to originType and simplify interface type handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Renamed parameter from `namedIntf` to `originType` for clarity - Removed redundant nil check since `b.abiType()` can handle both Named and Interface types - Simplified logic by always passing the origin type directly to `b.abiType()` 🤖 Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: luoliwoshang <51194195+luoliwoshang@users.noreply.github.com> --- ssa/interface.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ssa/interface.go b/ssa/interface.go index 9cf1ed3d..71f4a79c 100644 --- a/ssa/interface.go +++ b/ssa/interface.go @@ -43,16 +43,11 @@ func (b Builder) newItab(tintf, typ Expr) Expr { return b.Call(b.Pkg.rtFunc("NewItab"), tintf, typ) } -func (b Builder) unsafeInterface(rawIntf *types.Interface, namedIntf types.Type, t Expr, data llvm.Value) llvm.Value { +func (b Builder) unsafeInterface(rawIntf *types.Interface, originType types.Type, t Expr, data llvm.Value) llvm.Value { if rawIntf.Empty() { return b.unsafeEface(t.impl, data) } - var tintf Expr - if namedIntf != nil { - tintf = b.abiType(namedIntf) - } else { - tintf = b.abiType(rawIntf) - } + tintf := b.abiType(originType) itab := b.newItab(tintf, t) return b.unsafeIface(itab.impl, data) }