]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: minor change to simplify addition of experimental CLs
authorDavid Chase <drchase@google.com>
Thu, 16 Nov 2023 00:21:41 +0000 (19:21 -0500)
committerDavid Chase <drchase@google.com>
Thu, 16 Nov 2023 19:02:04 +0000 (19:02 +0000)
Two different experimental CLs need this change, this makes them
more focused and easier to apply or combine.

Change-Id: Ic7b5536394af20d9038bf3cc0cf22891555c7fa9
Reviewed-on: https://go-review.googlesource.com/c/go/+/542775
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/ssagen/ssa.go

index 24b82cffcd92ba47f28414049a2fe2aed4f88f62..8d1e30e1e65e2878462b5d9b3424fbaa2f05810c 100644 (file)
@@ -5298,11 +5298,11 @@ func (s *state) callAddr(n *ir.CallExpr, k callKind) *ssa.Value {
 // Returns the address of the return value (or nil if none).
 func (s *state) call(n *ir.CallExpr, k callKind, returnResultAddr bool, deferExtra ir.Expr) *ssa.Value {
        s.prevCall = nil
-       var callee *ir.Name    // target function (if static)
-       var closure *ssa.Value // ptr to closure to run (if dynamic)
-       var codeptr *ssa.Value // ptr to target code (if dynamic)
-       var dextra *ssa.Value  // defer extra arg
-       var rcvr *ssa.Value    // receiver to set
+       var calleeLSym *obj.LSym // target function (if static)
+       var closure *ssa.Value   // ptr to closure to run (if dynamic)
+       var codeptr *ssa.Value   // ptr to target code (if dynamic)
+       var dextra *ssa.Value    // defer extra arg
+       var rcvr *ssa.Value      // receiver to set
        fn := n.Fun
        var ACArgs []*types.Type    // AuxCall args
        var ACResults []*types.Type // AuxCall results
@@ -5318,7 +5318,7 @@ func (s *state) call(n *ir.CallExpr, k callKind, returnResultAddr bool, deferExt
        case ir.OCALLFUNC:
                if (k == callNormal || k == callTail) && fn.Op() == ir.ONAME && fn.(*ir.Name).Class == ir.PFUNC {
                        fn := fn.(*ir.Name)
-                       callee = fn
+                       calleeLSym = callTargetLSym(fn)
                        if buildcfg.Experiment.RegabiArgs {
                                // This is a static call, so it may be
                                // a direct call to a non-ABIInternal
@@ -5466,8 +5466,8 @@ func (s *state) call(n *ir.CallExpr, k callKind, returnResultAddr bool, deferExt
                        // Note that the "receiver" parameter is nil because the actual receiver is the first input parameter.
                        aux := ssa.InterfaceAuxCall(params)
                        call = s.newValue1A(ssa.OpInterLECall, aux.LateExpansionResultType(), aux, codeptr)
-               case callee != nil:
-                       aux := ssa.StaticAuxCall(callTargetLSym(callee), params)
+               case calleeLSym != nil:
+                       aux := ssa.StaticAuxCall(calleeLSym, params)
                        call = s.newValue0A(ssa.OpStaticLECall, aux.LateExpansionResultType(), aux)
                        if k == callTail {
                                call.Op = ssa.OpTailLECall