1
0
mirror of https://github.com/golang/go synced 2024-11-17 14:44:44 -07:00

cmd/compile/internal: fix a few function names on comments

Signed-off-by: cui fliter <imcusg@gmail.com>
This commit is contained in:
cui fliter 2022-10-02 11:31:09 +08:00
parent 1888875182
commit 58e0b75052
15 changed files with 18 additions and 18 deletions

View File

@ -18,7 +18,7 @@ import (
// TODO(mdempsky): Is there a higher-level abstraction that still // TODO(mdempsky): Is there a higher-level abstraction that still
// works well for iimport? // works well for iimport?
// mapFile returns length bytes from the file starting at the // MapFile returns length bytes from the file starting at the
// specified offset as a string. // specified offset as a string.
func MapFile(f *os.File, offset, length int64) (string, error) { func MapFile(f *os.File, offset, length int64) (string, error) {
// POSIX mmap: "The implementation may require that off is a // POSIX mmap: "The implementation may require that off is a

View File

@ -161,7 +161,7 @@ func UpdateErrorDot(line string, name, expr string) {
} }
} }
// Warnf reports a formatted warning at the current line. // Warn reports a formatted warning at the current line.
// In general the Go compiler does NOT generate warnings, // In general the Go compiler does NOT generate warnings,
// so this should be used only when the user has opted in // so this should be used only when the user has opted in
// to additional output by setting a particular flag. // to additional output by setting a particular flag.

View File

@ -79,7 +79,7 @@ const (
const io_SeekCurrent = 1 // io.SeekCurrent (not defined in Go 1.4) const io_SeekCurrent = 1 // io.SeekCurrent (not defined in Go 1.4)
// iImportData imports a package from the serialized package data // ImportData imports a package from the serialized package data
// and returns the number of bytes consumed and a reference to the package. // and returns the number of bytes consumed and a reference to the package.
// If the export data version is not recognized or the format is otherwise // If the export data version is not recognized or the format is otherwise
// compromised, an error is returned. // compromised, an error is returned.

View File

@ -33,7 +33,7 @@ func InitLSym(f *Func, hasBody bool) {
} }
} }
// setupTextLsym initializes the LSym for a with-body text symbol. // setupTextLSym initializes the LSym for a with-body text symbol.
func setupTextLSym(f *Func, flag int) { func setupTextLSym(f *Func, flag int) {
if f.Dupok() { if f.Dupok() {
flag |= obj.DUPOK flag |= obj.DUPOK

View File

@ -123,8 +123,8 @@ func (o Op) Format(s fmt.State, verb rune) {
// Node // Node
// FmtNode implements formatting for a Node n. // fmtNode implements formatting for a Node n.
// Every Node implementation must define a Format method that calls FmtNode. // Every Node implementation must define a Format method that calls fmtNode.
// The valid formats are: // The valid formats are:
// //
// %v Go syntax // %v Go syntax

View File

@ -329,7 +329,7 @@ func NewLoggedOpt(pos src.XPos, what, pass, funcName string, args ...interface{}
return &LoggedOpt{pos, pass, funcName, what, args} return &LoggedOpt{pos, pass, funcName, what, args}
} }
// Logopt logs information about a (usually missed) optimization performed by the compiler. // LogOpt logs information about a (usually missed) optimization performed by the compiler.
// Pos is the source position (including inlining), what is the message, pass is which pass created the message, // Pos is the source position (including inlining), what is the message, pass is which pass created the message,
// funcName is the name of the function // funcName is the name of the function
func LogOpt(pos src.XPos, what, pass, funcName string, args ...interface{}) { func LogOpt(pos src.XPos, what, pass, funcName string, args ...interface{}) {

View File

@ -2265,7 +2265,7 @@ func parameterizedBy1(t *types.Type, params []*types.Type, visited map[*types.Ty
} }
} }
// startClosures starts creation of a closure that has the function type typ. It // startClosure starts creation of a closure that has the function type typ. It
// creates all the formal params and results according to the type typ. On return, // creates all the formal params and results according to the type typ. On return,
// the body and closure variables of the closure must still be filled in, and // the body and closure variables of the closure must still be filled in, and
// ir.UseClosure() called. // ir.UseClosure() called.

View File

@ -73,7 +73,7 @@ func Global(s *obj.LSym, width int32, flags int16) {
base.Ctxt.Globl(s, int64(width), int(flags)) base.Ctxt.Globl(s, int64(width), int(flags))
} }
// Bitvec writes the contents of bv into s as sequence of bytes // BitVec writes the contents of bv into s as sequence of bytes
// in little-endian order, and returns the next unused offset. // in little-endian order, and returns the next unused offset.
func BitVec(s *obj.LSym, off int, bv bitvec.BitVec) int { func BitVec(s *obj.LSym, off int, bv bitvec.BitVec) int {
// Runtime reads the bitmaps as byte arrays. Oblige. // Runtime reads the bitmaps as byte arrays. Oblige.

View File

@ -1786,7 +1786,7 @@ func (x *expandState) newArgToMemOrRegs(baseArg, toReplace *Value, offset int64,
} }
// argOpAndRegisterFor converts an abi register index into an ssa Op and corresponding // ArgOpAndRegisterFor converts an abi register index into an ssa Op and corresponding
// arg register index. // arg register index.
func ArgOpAndRegisterFor(r abi.RegIndex, abiConfig *abi.ABIConfig) (Op, int64) { func ArgOpAndRegisterFor(r abi.RegIndex, abiConfig *abi.ABIConfig) (Op, int64) {
i := abiConfig.FloatIndexFor(r) i := abiConfig.FloatIndexFor(r)

View File

@ -478,7 +478,7 @@ const (
BoundsKindCount BoundsKindCount
) )
// boundsAPI determines which register arguments a bounds check call should use. For an [a:b:c] slice, we do: // boundsABI determines which register arguments a bounds check call should use. For an [a:b:c] slice, we do:
// //
// CMPQ c, cap // CMPQ c, cap
// JA fail1 // JA fail1

View File

@ -4,7 +4,7 @@
package ssa package ssa
// Shortcircuit finds situations where branch directions // shortcircuit finds situations where branch directions
// are always correlated and rewrites the CFG to take // are always correlated and rewrites the CFG to take
// advantage of that fact. // advantage of that fact.
// This optimization is useful for compiling && and || expressions. // This optimization is useful for compiling && and || expressions.

View File

@ -50,7 +50,7 @@ func NewFuncParams(tl *types.Type, mustname bool) []*ir.Field {
return args return args
} }
// newname returns a new ONAME Node associated with symbol s. // NewName returns a new ONAME Node associated with symbol s.
func NewName(s *types.Sym) *ir.Name { func NewName(s *types.Sym) *ir.Name {
n := ir.NewNameAt(base.Pos, s) n := ir.NewNameAt(base.Pos, s)
n.Curfn = ir.CurFunc n.Curfn = ir.CurFunc
@ -62,7 +62,7 @@ func NodAddr(n ir.Node) *ir.AddrExpr {
return NodAddrAt(base.Pos, n) return NodAddrAt(base.Pos, n)
} }
// nodAddrPos returns a node representing &n at position pos. // NodAddrAt returns a node representing &n at position pos.
func NodAddrAt(pos src.XPos, n ir.Node) *ir.AddrExpr { func NodAddrAt(pos src.XPos, n ir.Node) *ir.AddrExpr {
n = markAddrOf(n) n = markAddrOf(n)
return ir.NewAddrExpr(pos, n) return ir.NewAddrExpr(pos, n)
@ -1419,7 +1419,7 @@ func (ts *Tsubster) tinter(t *types.Type, force bool) *types.Type {
return t return t
} }
// genericSym returns the name of the base generic type for the type named by // genericTypeName returns the name of the base generic type for the type named by
// sym. It simply returns the name obtained by removing everything after the // sym. It simply returns the name obtained by removing everything after the
// first bracket ("["). // first bracket ("[").
func genericTypeName(sym *types.Sym) string { func genericTypeName(sym *types.Sym) string {

View File

@ -1805,7 +1805,7 @@ func fieldsHasShape(fields []*Field) bool {
return false return false
} }
// NewBasic returns a new basic type of the given kind. // newBasic returns a new basic type of the given kind.
func newBasic(kind Kind, obj Object) *Type { func newBasic(kind Kind, obj Object) *Type {
t := newType(kind) t := newType(kind)
t.obj = obj t.obj = obj

View File

@ -712,7 +712,7 @@ func walkDotType(n *ir.TypeAssertExpr, init *ir.Nodes) ir.Node {
return n return n
} }
// walkDynamicdotType walks an ODYNAMICDOTTYPE or ODYNAMICDOTTYPE2 node. // walkDynamicDotType walks an ODYNAMICDOTTYPE or ODYNAMICDOTTYPE2 node.
func walkDynamicDotType(n *ir.DynamicTypeAssertExpr, init *ir.Nodes) ir.Node { func walkDynamicDotType(n *ir.DynamicTypeAssertExpr, init *ir.Nodes) ir.Node {
n.X = walkExpr(n.X, init) n.X = walkExpr(n.X, init)
n.RType = walkExpr(n.RType, init) n.RType = walkExpr(n.RType, init)

View File

@ -44,7 +44,7 @@ type orderState struct {
edit func(ir.Node) ir.Node // cached closure of o.exprNoLHS edit func(ir.Node) ir.Node // cached closure of o.exprNoLHS
} }
// Order rewrites fn.Nbody to apply the ordering constraints // order rewrites fn.Nbody to apply the ordering constraints
// described in the comment at the top of the file. // described in the comment at the top of the file.
func order(fn *ir.Func) { func order(fn *ir.Func) {
if base.Flag.W > 1 { if base.Flag.W > 1 {