mirror of
https://github.com/golang/go.git
synced 2025-11-02 17:50:56 +00:00
cmd/compile/internal/ir: remove AsNode
Except for a single call site in escape analysis, every use of ir.AsNode involves a types.Object that's known to contain an *ir.Name. Asserting directly to that type makes the code simpler and more efficient. The one use in escape analysis is extended to handle nil correctly without it. Change-Id: I694ae516903e541341d82c2f65a9155e4b0a9809 Reviewed-on: https://go-review.googlesource.com/c/go/+/520775 TryBot-Bypass: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Auto-Submit: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This commit is contained in:
parent
4089b6a5b1
commit
7af28fa90e
6 changed files with 13 additions and 17 deletions
|
|
@ -1110,7 +1110,7 @@ func IsReflectHeaderDataField(l Node) bool {
|
|||
func ParamNames(ft *types.Type) []Node {
|
||||
args := make([]Node, ft.NumParams())
|
||||
for i, f := range ft.Params().FieldSlice() {
|
||||
args[i] = AsNode(f.Nname)
|
||||
args[i] = f.Nname.(*Name)
|
||||
}
|
||||
return args
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue