// 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
}
}
-// 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.
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.
}
}
-// 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
// 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
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{}) {
}
}
-// 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.
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.
}
-// 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)
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
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.
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
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)
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 {
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
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)
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 {