diff options
| author | Keith Randall <khr@golang.org> | 2014-07-31 12:43:40 -0700 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2014-07-31 12:43:40 -0700 |
| commit | cc9ec52d739ec3c9f2a3e9bfdcc98643bee61cca (patch) | |
| tree | 45b71559077a62fde3dd7bc477292538416da657 /src/cmd | |
| parent | 2c982ce9a0d30cf7c771d24b2d4d124b8230087a (diff) | |
| download | go-cc9ec52d739ec3c9f2a3e9bfdcc98643bee61cca.tar.xz | |
runtime: convert slice operations to Go.
LGTM=bradfitz, dvyukov
R=golang-codereviews, bradfitz, dvyukov
CC=golang-codereviews
https://golang.org/cl/120190044
Diffstat (limited to 'src/cmd')
| -rw-r--r-- | src/cmd/api/goapi.go | 2 | ||||
| -rw-r--r-- | src/cmd/gc/builtin.c | 2 | ||||
| -rw-r--r-- | src/cmd/gc/runtime.go | 2 | ||||
| -rw-r--r-- | src/cmd/gc/walk.c | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd/api/goapi.go b/src/cmd/api/goapi.go index 7216f4e0ed..932b5520f4 100644 --- a/src/cmd/api/goapi.go +++ b/src/cmd/api/goapi.go @@ -378,7 +378,7 @@ func (w *Walker) parseFile(dir, file string) (*ast.File, error) { } if w.context != nil && file == fmt.Sprintf("zruntime_defs_%s_%s.go", w.context.GOOS, w.context.GOARCH) { // Just enough to keep the api checker happy. - src := "package runtime; type maptype struct{}; type _type struct{}; type alg struct{}; type mspan struct{}; type m struct{}; type lock struct{}" + src := "package runtime; type maptype struct{}; type _type struct{}; type alg struct{}; type mspan struct{}; type m struct{}; type lock struct{}; type slicetype struct{};" f, err = parser.ParseFile(fset, filename, src, 0) if err != nil { log.Fatalf("incorrect generated file: %s", err) diff --git a/src/cmd/gc/builtin.c b/src/cmd/gc/builtin.c index 9de934b067..4808269b7f 100644 --- a/src/cmd/gc/builtin.c +++ b/src/cmd/gc/builtin.c @@ -39,7 +39,7 @@ char *runtimeimport = "func @\"\".stringtoslicerune (? string) (? []rune)\n" "func @\"\".stringiter (? string, ? int) (? int)\n" "func @\"\".stringiter2 (? string, ? int) (@\"\".retk·1 int, @\"\".retv·2 rune)\n" - "func @\"\".copy (@\"\".to·2 any, @\"\".fr·3 any, @\"\".wid·4 uintptr) (? int)\n" + "func @\"\".slicecopy (@\"\".to·2 any, @\"\".fr·3 any, @\"\".wid·4 uintptr) (? int)\n" "func @\"\".slicestringcopy (@\"\".to·2 any, @\"\".fr·3 any) (? int)\n" "func @\"\".typ2Itab (@\"\".typ·2 *byte, @\"\".typ2·3 *byte, @\"\".cache·4 **byte) (@\"\".ret·1 *byte)\n" "func @\"\".convI2E (@\"\".elem·2 any) (@\"\".ret·1 any)\n" diff --git a/src/cmd/gc/runtime.go b/src/cmd/gc/runtime.go index 2f282d6a03..0257c3c7d6 100644 --- a/src/cmd/gc/runtime.go +++ b/src/cmd/gc/runtime.go @@ -53,7 +53,7 @@ func stringtoslicebyte(string) []byte func stringtoslicerune(string) []rune func stringiter(string, int) int func stringiter2(string, int) (retk int, retv rune) -func copy(to any, fr any, wid uintptr) int +func slicecopy(to any, fr any, wid uintptr) int func slicestringcopy(to any, fr any) int // interface conversions diff --git a/src/cmd/gc/walk.c b/src/cmd/gc/walk.c index e8d9e1ebcc..be929e99ed 100644 --- a/src/cmd/gc/walk.c +++ b/src/cmd/gc/walk.c @@ -2623,7 +2623,7 @@ appendslice(Node *n, NodeList **init) if(l2->type->etype == TSTRING) fn = syslook("slicestringcopy", 1); else - fn = syslook("copy", 1); + fn = syslook("slicecopy", 1); argtype(fn, l1->type); argtype(fn, l2->type); nt = mkcall1(fn, types[TINT], &l, @@ -2761,7 +2761,7 @@ copyany(Node *n, NodeList **init, int runtimecall) if(n->right->type->etype == TSTRING) fn = syslook("slicestringcopy", 1); else - fn = syslook("copy", 1); + fn = syslook("slicecopy", 1); argtype(fn, n->left->type); argtype(fn, n->right->type); return mkcall1(fn, n->type, init, |
