}
// operand parses a general operand and stores the result in *a.
-func (p *Parser) operand(a *obj.Addr) bool {
+func (p *Parser) operand(a *obj.Addr) {
//fmt.Printf("Operand: %v\n", p.input)
if len(p.input) == 0 {
p.errorf("empty operand: cannot happen")
- return false
+ return
}
// General address (with a few exceptions) looks like
// $sym±offset(SB)(reg)(index*scale)
p.symbolReference(a, name, prefix)
// fmt.Printf("SYM %s\n", obj.Dconv(&emptyProg, 0, a))
if p.peek() == scanner.EOF {
- return true
+ return
}
}
}
p.registerList(a)
p.expectOperandEnd()
- return true
+ return
}
// Register: R1
}
// fmt.Printf("REG %s\n", obj.Dconv(&emptyProg, 0, a))
p.expectOperandEnd()
- return true
+ return
}
// Constant.
tok := p.next()
if tok.ScanToken == scanner.EOF {
p.errorf("missing right parenthesis")
- return false
+ return
}
rname := tok.String()
p.back()
a.Val = p.floatExpr()
// fmt.Printf("FCONST %s\n", obj.Dconv(&emptyProg, 0, a))
p.expectOperandEnd()
- return true
+ return
}
if p.have(scanner.String) {
if prefix != '$' {
p.errorf("string constant must be an immediate")
- return false
+ return
}
str, err := strconv.Unquote(p.get(scanner.String).String())
if err != nil {
a.Val = str
// fmt.Printf("SCONST %s\n", obj.Dconv(&emptyProg, 0, a))
p.expectOperandEnd()
- return true
+ return
}
a.Offset = int64(p.expr())
if p.peek() != '(' {
}
// fmt.Printf("CONST %d %s\n", a.Offset, obj.Dconv(&emptyProg, 0, a))
p.expectOperandEnd()
- return true
+ return
}
// fmt.Printf("offset %d \n", a.Offset)
}
// fmt.Printf("DONE %s\n", p.arch.Dconv(&emptyProg, 0, a))
p.expectOperandEnd()
- return true
+ return
}
// atStartOfRegister reports whether the parser is at the start of a register definition.
return t
}
-func tointerface0(t *types.Type, l []*Node) *types.Type {
+func tointerface0(t *types.Type, l []*Node) {
if t == nil || !t.IsInterface() {
Fatalf("interface expected")
}
fields = append(fields, f)
}
t.SetInterface(fields)
-
- return t
}
func fakeRecv() *Node {
ntypecheckdeftype--
}
-func typecheckdef(n *Node) *Node {
+func typecheckdef(n *Node) {
lno := lineno
setlineno(n)
yyerror("undefined: %v", n.Sym)
}
- return n
+ return
}
if n.Walkdef() == 1 {
- return n
+ return
}
typecheckdefstack = append(typecheckdefstack, n)
lineno = lno
n.SetWalkdef(1)
- return n
+ return
}
func checkmake(t *types.Type, arg string, n *Node) bool {
}
// mergePhi adjusts the number of `v`s arguments to account for merge
-// of `b`, which was `i`th predecessor of the `v`s block. Returns
-// `v`.
-func mergePhi(v *Value, i int, b *Block) *Value {
+// of `b`, which was `i`th predecessor of the `v`s block.
+func mergePhi(v *Value, i int, b *Block) {
u := v.Args[i]
if u.Block == b {
if u.Op != OpPhi {
v.AddArg(v.Args[i])
}
}
- return v
}
// load populates p using information from bp, err, which should
// be the result of calling build.Context.Import.
-func (p *Package) load(stk *ImportStack, bp *build.Package, err error) *Package {
+func (p *Package) load(stk *ImportStack, bp *build.Package, err error) {
p.copyBuild(bp)
// The localPrefix is the path we interpret ./ imports relative to.
ImportStack: stk.Copy(),
Err: err.Error(),
}
- return p
+ return
}
useBindir := p.Name == "main"
newPath := strings.Replace(p.ImportPath, "code.google.com/p/go.", "golang.org/x/", 1)
e := fmt.Sprintf("the %v command has moved; use %v instead.", p.ImportPath, newPath)
p.Error = &PackageError{Err: e}
- return p
+ return
}
_, elem := filepath.Split(p.Dir)
full := cfg.BuildContext.GOOS + "_" + cfg.BuildContext.GOARCH + "/" + elem
ImportStack: stk.Copy(),
Err: fmt.Sprintf("case-insensitive file name collision: %q and %q", f1, f2),
}
- return p
+ return
}
// Build list of imported packages and full dependency list.
ImportStack: stk.Copy(),
Err: fmt.Sprintf("C source files not allowed when not using cgo or SWIG: %s", strings.Join(p.CFiles, " ")),
}
- return p
+ return
}
// Check for case-insensitive collisions of import paths.
ImportStack: stk.Copy(),
Err: fmt.Sprintf("case-insensitive import collision: %q and %q", p.ImportPath, other),
}
- return p
+ return
}
if p.BinaryOnly {
} else {
computeBuildID(p)
}
- return p
}
// InternalDeps returns the full dependency list for p,
}
// NOTE: keep in sync with stringBytes below.
-func (e *encodeState) string(s string, escapeHTML bool) int {
- len0 := e.Len()
+func (e *encodeState) string(s string, escapeHTML bool) {
e.WriteByte('"')
start := 0
for i := 0; i < len(s); {
e.WriteString(s[start:])
}
e.WriteByte('"')
- return e.Len() - len0
}
// NOTE: keep in sync with string above.
-func (e *encodeState) stringBytes(s []byte, escapeHTML bool) int {
- len0 := e.Len()
+func (e *encodeState) stringBytes(s []byte, escapeHTML bool) {
e.WriteByte('"')
start := 0
for i := 0; i < len(s); {
e.Write(s[start:])
}
e.WriteByte('"')
- return e.Len() - len0
}
// A field represents a single field found in a struct.
// run executes the benchmark in a separate goroutine, including all of its
// subbenchmarks. b must not have subbenchmarks.
-func (b *B) run() BenchmarkResult {
+func (b *B) run() {
labelsOnce.Do(func() {
fmt.Fprintf(b.w, "goos: %s\n", runtime.GOOS)
fmt.Fprintf(b.w, "goarch: %s\n", runtime.GOARCH)
// Running func Benchmark.
b.doBench()
}
- return b.result
}
func (b *B) doBench() BenchmarkResult {