Commit 27838f39 authored by Robert Griesemer's avatar Robert Griesemer

cmd/compile/internal/gc: remove atoi function (minor cleanup)

Change-Id: I0ad7836c0e8d70ffdc458e125d97b01e85d8a608
Reviewed-on: https://go-review.googlesource.com/16130Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 30ee5919
...@@ -7,6 +7,7 @@ package gc ...@@ -7,6 +7,7 @@ package gc
import ( import (
"cmd/internal/obj" "cmd/internal/obj"
"fmt" "fmt"
"strconv"
"strings" "strings"
) )
...@@ -1124,7 +1125,8 @@ func parsetag(note *string) uint16 { ...@@ -1124,7 +1125,8 @@ func parsetag(note *string) uint16 {
if note == nil || !strings.HasPrefix(*note, "esc:") { if note == nil || !strings.HasPrefix(*note, "esc:") {
return EscUnknown return EscUnknown
} }
em := uint16(atoi((*note)[4:])) n, _ := strconv.ParseInt((*note)[4:], 0, 0)
em := uint16(n)
if em == 0 { if em == 0 {
return EscNone return EscNone
} }
......
...@@ -4,19 +4,12 @@ import ( ...@@ -4,19 +4,12 @@ import (
"os" "os"
"runtime" "runtime"
"runtime/pprof" "runtime/pprof"
"strconv"
) )
func (n *Node) Line() string { func (n *Node) Line() string {
return Ctxt.LineHist.LineString(int(n.Lineno)) return Ctxt.LineHist.LineString(int(n.Lineno))
} }
func atoi(s string) int {
// NOTE: Not strconv.Atoi, accepts hex and octal prefixes.
n, _ := strconv.ParseInt(s, 0, 0)
return int(n)
}
var atExitFuncs []func() var atExitFuncs []func()
func AtExit(f func()) { func AtExit(f func()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment