refactor(ssa): rename namedIntf to originType and simplify interface type handling
- 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>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user