]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/ir: fix doc
authorkumakichi <xyesan@gmail.com>
Thu, 29 Apr 2021 05:45:35 +0000 (05:45 +0000)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 29 Apr 2021 14:12:53 +0000 (14:12 +0000)
Change-Id: I8fc77e29cb44fef264a62ff00452b9fcf6e30be8
GitHub-Last-Rev: 414cda8ce6e64fb53d3d1ec01caa7e33c0219236
GitHub-Pull-Request: golang/go#45842
Reviewed-on: https://go-review.googlesource.com/c/go/+/314990
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>

src/cmd/compile/internal/ir/dump.go
src/cmd/compile/internal/ir/expr.go
src/cmd/compile/internal/ir/func.go
src/cmd/compile/internal/ir/node.go
src/cmd/compile/internal/ir/stmt.go
src/cmd/compile/internal/ir/val.go

index fc995cee6202f0107a0c98e400000080ea58ace9..59914baa5cc04cfe367fcfb51328805604e91e08 100644 (file)
@@ -20,12 +20,12 @@ import (
        "cmd/internal/src"
 )
 
-// dump is like fdump but prints to stderr.
+// DumpAny is like FDumpAny but prints to stderr.
 func DumpAny(root interface{}, filter string, depth int) {
        FDumpAny(os.Stderr, root, filter, depth)
 }
 
-// fdump prints the structure of a rooted data structure
+// FDumpAny prints the structure of a rooted data structure
 // to w by depth-first traversal of the data structure.
 //
 // The filter parameter is a regular expression. If it is
index a9f8c6eae5f7ac0f80ad5ba65d2a63356529e442..94255116a0b133398e422f3b526c0656c13df92d 100644 (file)
@@ -1060,7 +1060,7 @@ func MethodSymSuffix(recv *types.Type, msym *types.Sym, suffix string) *types.Sy
        return rpkg.LookupBytes(b.Bytes())
 }
 
-// MethodName returns the ONAME representing the method
+// MethodExprName returns the ONAME representing the method
 // referenced by expression n, which must be a method selector,
 // method expression, or method value.
 func MethodExprName(n Node) *Name {
@@ -1068,7 +1068,7 @@ func MethodExprName(n Node) *Name {
        return name
 }
 
-// MethodFunc is like MethodName, but returns the types.Field instead.
+// MethodExprFunc is like MethodExprName, but returns the types.Field instead.
 func MethodExprFunc(n Node) *types.Field {
        switch n.Op() {
        case ODOTMETH, OMETHEXPR, OCALLPART:
index bcedfe138c58a8fbaaddafcc2372850f8af1d2c8..385866b3c87c6da89ff5846a04d59de98cb2522f 100644 (file)
@@ -238,7 +238,7 @@ func (f *Func) SetWBPos(pos src.XPos) {
        }
 }
 
-// funcname returns the name (without the package) of the function n.
+// FuncName returns the name (without the package) of the function n.
 func FuncName(f *Func) string {
        if f == nil || f.Nname == nil {
                return "<nil>"
@@ -246,7 +246,7 @@ func FuncName(f *Func) string {
        return f.Sym().Name
 }
 
-// pkgFuncName returns the name of the function referenced by n, with package prepended.
+// PkgFuncName returns the name of the function referenced by n, with package prepended.
 // This differs from the compiler's internal convention where local functions lack a package
 // because the ultimate consumer of this is a human looking at an IDE; package is only empty
 // if the compilation package is actually the empty string.
index cbc7681d12254f9bfe64d55f8c40e963344c645c..a73b81d196edaa33b91c3daccd5ee680261e8ea3 100644 (file)
@@ -80,7 +80,7 @@ func IsAutoTmp(n Node) bool {
        return n.Name().AutoTemp()
 }
 
-// mayBeShared reports whether n may occur in multiple places in the AST.
+// MayBeShared reports whether n may occur in multiple places in the AST.
 // Extra care must be taken when mutating such a node.
 func MayBeShared(n Node) bool {
        switch n.Op() {
@@ -477,7 +477,7 @@ func IsConst(n Node, ct constant.Kind) bool {
        return ConstType(n) == ct
 }
 
-// isNil reports whether n represents the universal untyped zero value "nil".
+// IsNil reports whether n represents the universal untyped zero value "nil".
 func IsNil(n Node) bool {
        // Check n.Orig because constant propagation may produce typed nil constants,
        // which don't exist in the Go spec.
index c304867e1d9a9dc662c48cb54fb925f8558fcf5a..8115012f97852c030d59b0e74bdd0cad17825916 100644 (file)
@@ -224,7 +224,7 @@ func (n *ForStmt) SetOp(op Op) {
 
 // A GoDeferStmt is a go or defer statement: go Call / defer Call.
 //
-// The two opcodes use a signle syntax because the implementations
+// The two opcodes use a single syntax because the implementations
 // are very similar: both are concerned with saving Call and running it
 // in a different context (a separate goroutine or a later time).
 type GoDeferStmt struct {
index ff45f31074e1c39b9d1509407edafd4695f68948..03c320e205dbfdf8b6b46eb7d3d9adcc8295c46d 100644 (file)
@@ -19,7 +19,7 @@ func ConstType(n Node) constant.Kind {
        return n.Val().Kind()
 }
 
-// ValueInterface returns the constant value stored in n as an interface{}.
+// ConstValue returns the constant value stored in n as an interface{}.
 // It returns int64s for ints and runes, float64s for floats,
 // and complex128s for complex values.
 func ConstValue(n Node) interface{} {
@@ -40,7 +40,7 @@ func ConstValue(n Node) interface{} {
        }
 }
 
-// int64Val returns v converted to int64.
+// IntVal returns v converted to int64.
 // Note: if t is uint64, very large values will be converted to negative int64.
 func IntVal(t *types.Type, v constant.Value) int64 {
        if t.IsUnsigned() {
@@ -90,7 +90,7 @@ func ValidTypeForConst(t *types.Type, v constant.Value) bool {
        panic("unreachable")
 }
 
-// nodlit returns a new untyped constant with value v.
+// NewLiteral returns a new untyped constant with value v.
 func NewLiteral(v constant.Value) Node {
        return NewBasicLit(base.Pos, v)
 }