mirror of
https://github.com/golang/go
synced 2024-11-17 11:54:54 -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:
parent
1888875182
commit
58e0b75052
@ -18,7 +18,7 @@ import (
|
||||
// TODO(mdempsky): Is there a higher-level abstraction that still
|
||||
// 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.
|
||||
func MapFile(f *os.File, offset, length int64) (string, error) {
|
||||
// POSIX mmap: "The implementation may require that off is a
|
||||
|
@ -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,
|
||||
// so this should be used only when the user has opted in
|
||||
// to additional output by setting a particular flag.
|
||||
|
@ -79,7 +79,7 @@ const (
|
||||
|
||||
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.
|
||||
// If the export data version is not recognized or the format is otherwise
|
||||
// compromised, an error is returned.
|
||||
|
@ -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) {
|
||||
if f.Dupok() {
|
||||
flag |= obj.DUPOK
|
||||
|
@ -123,8 +123,8 @@ func (o Op) Format(s fmt.State, verb rune) {
|
||||
|
||||
// Node
|
||||
|
||||
// FmtNode implements formatting for a Node n.
|
||||
// Every Node implementation must define a Format method that calls FmtNode.
|
||||
// fmtNode implements formatting for a Node n.
|
||||
// Every Node implementation must define a Format method that calls fmtNode.
|
||||
// The valid formats are:
|
||||
//
|
||||
// %v Go syntax
|
||||
|
@ -329,7 +329,7 @@ func NewLoggedOpt(pos src.XPos, what, pass, funcName string, args ...interface{}
|
||||
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,
|
||||
// funcName is the name of the function
|
||||
func LogOpt(pos src.XPos, what, pass, funcName string, args ...interface{}) {
|
||||
|
@ -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,
|
||||
// the body and closure variables of the closure must still be filled in, and
|
||||
// ir.UseClosure() called.
|
||||
|
@ -73,7 +73,7 @@ func Global(s *obj.LSym, width int32, flags int16) {
|
||||
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.
|
||||
func BitVec(s *obj.LSym, off int, bv bitvec.BitVec) int {
|
||||
// Runtime reads the bitmaps as byte arrays. Oblige.
|
||||
|
@ -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.
|
||||
func ArgOpAndRegisterFor(r abi.RegIndex, abiConfig *abi.ABIConfig) (Op, int64) {
|
||||
i := abiConfig.FloatIndexFor(r)
|
||||
|
@ -478,7 +478,7 @@ const (
|
||||
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
|
||||
// JA fail1
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
package ssa
|
||||
|
||||
// Shortcircuit finds situations where branch directions
|
||||
// shortcircuit finds situations where branch directions
|
||||
// are always correlated and rewrites the CFG to take
|
||||
// advantage of that fact.
|
||||
// This optimization is useful for compiling && and || expressions.
|
||||
|
@ -50,7 +50,7 @@ func NewFuncParams(tl *types.Type, mustname bool) []*ir.Field {
|
||||
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 {
|
||||
n := ir.NewNameAt(base.Pos, s)
|
||||
n.Curfn = ir.CurFunc
|
||||
@ -62,7 +62,7 @@ func NodAddr(n ir.Node) *ir.AddrExpr {
|
||||
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 {
|
||||
n = markAddrOf(n)
|
||||
return ir.NewAddrExpr(pos, n)
|
||||
@ -1419,7 +1419,7 @@ func (ts *Tsubster) tinter(t *types.Type, force bool) *types.Type {
|
||||
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
|
||||
// first bracket ("[").
|
||||
func genericTypeName(sym *types.Sym) string {
|
||||
|
@ -1805,7 +1805,7 @@ func fieldsHasShape(fields []*Field) bool {
|
||||
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 {
|
||||
t := newType(kind)
|
||||
t.obj = obj
|
||||
|
@ -712,7 +712,7 @@ func walkDotType(n *ir.TypeAssertExpr, init *ir.Nodes) ir.Node {
|
||||
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 {
|
||||
n.X = walkExpr(n.X, init)
|
||||
n.RType = walkExpr(n.RType, init)
|
||||
|
@ -44,7 +44,7 @@ type orderState struct {
|
||||
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.
|
||||
func order(fn *ir.Func) {
|
||||
if base.Flag.W > 1 {
|
||||
|
Loading…
Reference in New Issue
Block a user