Skip to content

Commit 3a7a528

Browse files
cuishuanggopherbot
authored andcommitted
all: fix some comments for method
Change-Id: I4cff6b2a1fed6acdf754539c3c53a61eaa3b3f84 Reviewed-on: https://go-review.googlesource.com/c/go/+/450176 Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Keith Randall <[email protected]> Reviewed-by: Keith Randall <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Martin Möhrmann <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent c0497d1 commit 3a7a528

File tree

18 files changed

+31
-31
lines changed

18 files changed

+31
-31
lines changed

src/archive/tar/format.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func (b *block) toSTAR() *headerSTAR { return (*headerSTAR)(b) }
166166
func (b *block) toUSTAR() *headerUSTAR { return (*headerUSTAR)(b) }
167167
func (b *block) toSparse() sparseArray { return sparseArray(b[:]) }
168168

169-
// GetFormat checks that the block is a valid tar header based on the checksum.
169+
// getFormat checks that the block is a valid tar header based on the checksum.
170170
// It then attempts to guess the specific format based on magic values.
171171
// If the checksum fails, then FormatUnknown is returned.
172172
func (b *block) getFormat() Format {
@@ -239,7 +239,7 @@ func (b *block) computeChecksum() (unsigned, signed int64) {
239239
return unsigned, signed
240240
}
241241

242-
// Reset clears the block with all zeros.
242+
// reset clears the block with all zeros.
243243
func (b *block) reset() {
244244
*b = block{}
245245
}

src/archive/tar/reader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ func (fr regFileReader) logicalRemaining() int64 {
696696
return fr.nb
697697
}
698698

699-
// logicalRemaining implements fileState.physicalRemaining.
699+
// physicalRemaining implements fileState.physicalRemaining.
700700
func (fr regFileReader) physicalRemaining() int64 {
701701
return fr.nb
702702
}

src/archive/tar/writer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ func (fw regFileWriter) logicalRemaining() int64 {
519519
return fw.nb
520520
}
521521

522-
// logicalRemaining implements fileState.physicalRemaining.
522+
// physicalRemaining implements fileState.physicalRemaining.
523523
func (fw regFileWriter) physicalRemaining() int64 {
524524
return fw.nb
525525
}

src/cmd/compile/internal/abt/avlint32.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func makeNode(key int32) *node32 {
3737
return &node32{key: key, height_: LEAF_HEIGHT}
3838
}
3939

40-
// IsSingle returns true iff t is empty.
40+
// IsEmpty returns true iff t is empty.
4141
func (t *T) IsEmpty() bool {
4242
return t.root == nil
4343
}

src/cmd/compile/internal/amd64/ssa.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"cmd/internal/obj/x86"
2121
)
2222

23-
// markMoves marks any MOVXconst ops that need to avoid clobbering flags.
23+
// ssaMarkMoves marks any MOVXconst ops that need to avoid clobbering flags.
2424
func ssaMarkMoves(s *ssagen.State, b *ssa.Block) {
2525
flive := b.FlagsLiveAtEnd
2626
for _, c := range b.ControlValues() {

src/cmd/compile/internal/logopt/log_opts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func parseLogFlag(flag, value string) (version int, directory string) {
270270
return
271271
}
272272

273-
// isWindowsDriveURI returns true if the file URI is of the format used by
273+
// isWindowsDriveURIPath returns true if the file URI is of the format used by
274274
// Windows URIs. The url.Parse package does not specially handle Windows paths
275275
// (see golang/go#6027), so we check if the URI path has a drive prefix (e.g. "/C:").
276276
// (copied from tools/internal/span/uri.go)

src/cmd/compile/internal/ppc64/ssa.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
"strings"
2020
)
2121

22-
// markMoves marks any MOVXconst ops that need to avoid clobbering flags.
22+
// ssaMarkMoves marks any MOVXconst ops that need to avoid clobbering flags.
2323
func ssaMarkMoves(s *ssagen.State, b *ssa.Block) {
2424
// flive := b.FlagsLiveAtEnd
2525
// if b.Control != nil && b.Control.Type.IsFlags() {

src/cmd/compile/internal/riscv64/ssa.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func largestMove(alignment int64) (obj.As, int64) {
179179
}
180180
}
181181

182-
// markMoves marks any MOVXconst ops that need to avoid clobbering flags.
182+
// ssaMarkMoves marks any MOVXconst ops that need to avoid clobbering flags.
183183
// RISC-V has no flags, so this is a no-op.
184184
func ssaMarkMoves(s *ssagen.State, b *ssa.Block) {}
185185

src/cmd/compile/internal/s390x/ssa.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"cmd/internal/obj/s390x"
1717
)
1818

19-
// markMoves marks any MOVXconst ops that need to avoid clobbering flags.
19+
// ssaMarkMoves marks any MOVXconst ops that need to avoid clobbering flags.
2020
func ssaMarkMoves(s *ssagen.State, b *ssa.Block) {
2121
flive := b.FlagsLiveAtEnd
2222
for _, c := range b.ControlValues() {

src/cmd/compile/internal/ssa/dom.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func (f *Func) dominatorsLTOrig(entry *Block, predFn linkedBlocks, succFn linked
144144
return idom
145145
}
146146

147-
// dfs performs a depth first search over the blocks starting at entry block
147+
// dfsOrig performs a depth first search over the blocks starting at entry block
148148
// (in arbitrary order). This is a de-recursed version of dfs from the
149149
// original Tarjan-Lengauer TOPLAS article. It's important to return the
150150
// same values for parent as the original algorithm.
@@ -203,7 +203,7 @@ func linkOrig(v, w ID, ancestor []ID) {
203203
ancestor[w] = v
204204
}
205205

206-
// dominators computes the dominator tree for f. It returns a slice
206+
// dominatorsSimple computes the dominator tree for f. It returns a slice
207207
// which maps block ID to the immediate dominator of that block.
208208
// Unreachable blocks map to nil. The entry block maps to nil.
209209
func dominatorsSimple(f *Func) []*Block {

src/cmd/compile/internal/ssa/func.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ func (f *Func) newValueNoBlock(op Op, t *types.Type, pos src.XPos) *Value {
304304
return v
305305
}
306306

307-
// logPassStat writes a string key and int value as a warning in a
307+
// LogStat writes a string key and int value as a warning in a
308308
// tab-separated format easily handled by spreadsheets or awk.
309309
// file names, lines, and function names are included to provide enough (?)
310310
// context to allow item-by-item comparisons across runs.
@@ -387,7 +387,7 @@ func (f *Func) freeValue(v *Value) {
387387
f.freeValues = v
388388
}
389389

390-
// newBlock allocates a new Block of the given kind and places it at the end of f.Blocks.
390+
// NewBlock allocates a new Block of the given kind and places it at the end of f.Blocks.
391391
func (f *Func) NewBlock(kind BlockKind) *Block {
392392
var b *Block
393393
if f.freeBlocks != nil {
@@ -433,15 +433,15 @@ func (b *Block) NewValue0(pos src.XPos, op Op, t *types.Type) *Value {
433433
return v
434434
}
435435

436-
// NewValue returns a new value in the block with no arguments and an auxint value.
436+
// NewValue0I returns a new value in the block with no arguments and an auxint value.
437437
func (b *Block) NewValue0I(pos src.XPos, op Op, t *types.Type, auxint int64) *Value {
438438
v := b.Func.newValue(op, t, b, pos)
439439
v.AuxInt = auxint
440440
v.Args = v.argstorage[:0]
441441
return v
442442
}
443443

444-
// NewValue returns a new value in the block with no arguments and an aux value.
444+
// NewValue0A returns a new value in the block with no arguments and an aux value.
445445
func (b *Block) NewValue0A(pos src.XPos, op Op, t *types.Type, aux Aux) *Value {
446446
v := b.Func.newValue(op, t, b, pos)
447447
v.AuxInt = 0
@@ -450,7 +450,7 @@ func (b *Block) NewValue0A(pos src.XPos, op Op, t *types.Type, aux Aux) *Value {
450450
return v
451451
}
452452

453-
// NewValue returns a new value in the block with no arguments and both an auxint and aux values.
453+
// NewValue0IA returns a new value in the block with no arguments and both an auxint and aux values.
454454
func (b *Block) NewValue0IA(pos src.XPos, op Op, t *types.Type, auxint int64, aux Aux) *Value {
455455
v := b.Func.newValue(op, t, b, pos)
456456
v.AuxInt = auxint
@@ -654,7 +654,7 @@ const (
654654
constEmptyStringMagic = 4455667788
655655
)
656656

657-
// ConstInt returns an int constant representing its argument.
657+
// ConstBool returns an int constant representing its argument.
658658
func (f *Func) ConstBool(t *types.Type, c bool) *Value {
659659
i := int64(0)
660660
if c {

src/cmd/compile/internal/ssa/magic.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ type smagicData struct {
181181
m uint64 // ⎡2^(n+s)/c⎤
182182
}
183183

184-
// magic computes the constants needed to strength reduce signed n-bit divides by the constant c.
184+
// smagic computes the constants needed to strength reduce signed n-bit divides by the constant c.
185185
// Must have c>0.
186186
// The return values satisfy for all -2^(n-1) <= x < 2^(n-1)
187187
//

src/cmd/compile/internal/ssa/rewrite.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ func canLoadUnaligned(c *Config) bool {
423423
return c.ctxt.Arch.Alignment == 1
424424
}
425425

426-
// nlz returns the number of leading zeros.
426+
// nlzX returns the number of leading zeros.
427427
func nlz64(x int64) int { return bits.LeadingZeros64(uint64(x)) }
428428
func nlz32(x int32) int { return bits.LeadingZeros32(uint32(x)) }
429429
func nlz16(x int16) int { return bits.LeadingZeros16(uint16(x)) }
@@ -467,7 +467,7 @@ func log2uint32(n int64) int64 {
467467
return int64(bits.Len32(uint32(n))) - 1
468468
}
469469

470-
// isPowerOfTwo functions report whether n is a power of 2.
470+
// isPowerOfTwoX functions report whether n is a power of 2.
471471
func isPowerOfTwo8(n int8) bool {
472472
return n > 0 && n&(n-1) == 0
473473
}

src/cmd/compile/internal/ssagen/ssa.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ func (s *state) newValue4(op ssa.Op, t *types.Type, arg0, arg1, arg2, arg3 *ssa.
11131113
return s.curBlock.NewValue4(s.peekPos(), op, t, arg0, arg1, arg2, arg3)
11141114
}
11151115

1116-
// newValue4 adds a new value with four arguments and an auxint value to the current block.
1116+
// newValue4I adds a new value with four arguments and an auxint value to the current block.
11171117
func (s *state) newValue4I(op ssa.Op, t *types.Type, aux int64, arg0, arg1, arg2, arg3 *ssa.Value) *ssa.Value {
11181118
return s.curBlock.NewValue4I(s.peekPos(), op, t, aux, arg0, arg1, arg2, arg3)
11191119
}
@@ -1145,7 +1145,7 @@ func (s *state) entryNewValue1(op ssa.Op, t *types.Type, arg *ssa.Value) *ssa.Va
11451145
return s.entryBlock().NewValue1(src.NoXPos, op, t, arg)
11461146
}
11471147

1148-
// entryNewValue1 adds a new value with one argument and an auxint value to the entry block.
1148+
// entryNewValue1I adds a new value with one argument and an auxint value to the entry block.
11491149
func (s *state) entryNewValue1I(op ssa.Op, t *types.Type, auxint int64, arg *ssa.Value) *ssa.Value {
11501150
return s.entryBlock().NewValue1I(src.NoXPos, op, t, auxint, arg)
11511151
}
@@ -7813,7 +7813,7 @@ func (e *ssafn) Line(pos src.XPos) string {
78137813
return base.FmtPos(pos)
78147814
}
78157815

7816-
// Log logs a message from the compiler.
7816+
// Logf logs a message from the compiler.
78177817
func (e *ssafn) Logf(msg string, args ...interface{}) {
78187818
if e.log {
78197819
fmt.Printf(msg, args...)
@@ -7824,7 +7824,7 @@ func (e *ssafn) Log() bool {
78247824
return e.log
78257825
}
78267826

7827-
// Fatal reports a compiler error and exits.
7827+
// Fatalf reports a compiler error and exits.
78287828
func (e *ssafn) Fatalf(pos src.XPos, msg string, args ...interface{}) {
78297829
base.Pos = pos
78307830
nargs := append([]interface{}{ir.FuncName(e.curfn)}, args...)
@@ -7952,7 +7952,7 @@ func deferstruct() *types.Type {
79527952
return s
79537953
}
79547954

7955-
// SlotAddr uses LocalSlot information to initialize an obj.Addr
7955+
// SpillSlotAddr uses LocalSlot information to initialize an obj.Addr
79567956
// The resulting addr is used in a non-standard context -- in the prologue
79577957
// of a function, before the frame has been constructed, so the standard
79587958
// addressing for the parameters will be wrong.

src/cmd/compile/internal/syntax/parser.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ func (p *parser) posAt(line, col uint) Pos {
217217
return MakePos(p.base, line, col)
218218
}
219219

220-
// error reports an error at the given position.
220+
// errorAt reports an error at the given position.
221221
func (p *parser) errorAt(pos Pos, msg string) {
222222
err := Error{pos, msg}
223223
if p.first == nil {
@@ -314,7 +314,7 @@ const stopset uint64 = 1<<_Break |
314314
1<<_Type |
315315
1<<_Var
316316

317-
// Advance consumes tokens until it finds a token of the stopset or followlist.
317+
// advance consumes tokens until it finds a token of the stopset or followlist.
318318
// The stopset is only considered if we are inside a function (p.fnest > 0).
319319
// The followlist is the list of valid tokens that can follow a production;
320320
// if it is empty, exactly one (non-EOF) token is consumed to ensure progress.

src/cmd/compile/internal/x86/ssa.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"cmd/internal/obj/x86"
1919
)
2020

21-
// markMoves marks any MOVXconst ops that need to avoid clobbering flags.
21+
// ssaMarkMoves marks any MOVXconst ops that need to avoid clobbering flags.
2222
func ssaMarkMoves(s *ssagen.State, b *ssa.Block) {
2323
flive := b.FlagsLiveAtEnd
2424
for _, c := range b.ControlValues() {

test/typeparam/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ type _ListNum[T OrderedNum] struct {
4747

4848
const Clip = 5
4949

50-
// clippedLargest returns the largest in the list of OrderNums, but a max of 5.
50+
// ClippedLargest returns the largest in the list of OrderNums, but a max of 5.
5151
// Test use of untyped constant in an expression with a generically-typed parameter
5252
func (l *_ListNum[T]) ClippedLargest() T {
5353
var max T

test/typeparam/listimp.dir/a.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type ListNum[T OrderedNum] struct {
4141

4242
const Clip = 5
4343

44-
// clippedLargest returns the largest in the list of OrderNums, but a max of 5.
44+
// ClippedLargest returns the largest in the list of OrderNums, but a max of 5.
4545
func (l *ListNum[T]) ClippedLargest() T {
4646
var max T
4747
for p := l; p != nil; p = p.Next {

0 commit comments

Comments
 (0)