- 13 Feb, 2018 18 commits
-
-
Austin Clements authored
Updates #22460. Change-Id: I9718bff3a346e765601cfd1890417bdfa0f7b9d8 Reviewed-on: https://go-review.googlesource.com/92700 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Austin Clements authored
Updates #22460. Change-Id: I5f8fbece9545840f5fc4c9834e2050b0920776f0 Reviewed-on: https://go-review.googlesource.com/92699 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Austin Clements authored
Updates #22460. Change-Id: I5581df7ad553237db7df3701b117ad99e0593b78 Reviewed-on: https://go-review.googlesource.com/92698 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Austin Clements authored
Updates #22460. Change-Id: I6656d478625e5e54aa2eaa38d99dfb0f71ea1fdd Reviewed-on: https://go-review.googlesource.com/92697 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Austin Clements authored
Updates #22460. Change-Id: I3c8e90fd6bcda7e28911036591873d63665aaca7 Reviewed-on: https://go-review.googlesource.com/92696 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Austin Clements authored
Because a call may ultimately invoke runtime.setg, we have to assume that g may be clobbered by any call. All of the other architectures that use a g register already do this, but it was missing from the s390x caller save clobber set. Change-Id: Ia931638d42c44979839f20d71097acf31475f423 Reviewed-on: https://go-review.googlesource.com/92835 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Cherry Zhang authored
R28 is used as the SB register on MIPS64, and it was printed as "RSB" on both 32-bit and 64-bit MIPS. This is confusing on MIPS32 as there R28 is just a general purpose register. Further, this string representation is used in the assembler's frontend to parse register symbols, and this leads to failure in parsing R28 in MIPS32 assembly code. Change rconv to always print the register as R28. This fixes the parsing problem on MIPS32, and this is a reasonable representation on both MIPS32 and MIPS64. Change-Id: I30d6c0a442fbb08ea615f32f1763b5baadcee1da Reviewed-on: https://go-review.googlesource.com/92915 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
-
Cherry Zhang authored
On mips/mips64, for non-leaf function, RET is assembled as MOV (SP), R4 // load saved LR ADD $framesize, SP JMP (R4) This clobbers R4 unnecessarily. Use the link register as temporary instead. Probably for Go 1.11. Change-Id: I2209db7be11074ed2e0e0829cace95ebfb709e9f Reviewed-on: https://go-review.googlesource.com/79016 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Austin Clements <austin@google.com>
-
Tobias Klauser authored
Add the rawSyscallNoError wrapper function which is used for Linux syscalls that don't return an error and convert all applicable occurences of RawSyscall to use it instead. Fixes #22924 Change-Id: Iff1eddb54573d459faa01471f10398b3d38528dd Reviewed-on: https://go-review.googlesource.com/84485 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Tobias Klauser authored
All supported BSDs provide the SYS___GETCWD syscall which can be used to implement syscall.Getwd. With this change os.Getwd can use a single syscall instead of falling back to the current kludge solution on the BSDs. This doesn't add any new exported functions to the frozen syscall package, only ImplementsGetwd changes to true for dragonfly, freebsd, netbsd and openbsd. As suggested by Ian, this follows CL 83755 which did the same for golang.org/x/sys/unix. Also, an entry for netbsd/arm is added to mkall.sh which was used to generate the syscall wrappers there. Change-Id: I84da1ec61a6b8625443699a63cde556b6442ad41 Reviewed-on: https://go-review.googlesource.com/84484Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Tobias Klauser authored
The function was duplicated for Solaris. Reuse the BSD version instead. Change-Id: Ibc812bcf36d21f4a7ceeef7b4fb091fa9479bfa8 Reviewed-on: https://go-review.googlesource.com/81395 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Jason A. Donenfeld authored
Android O disallows open on 64-bit, so let's use openat with AT_FDCWD to achieve the same behavior. Android O disallows epoll_wait on 64-bit, so let's use epoll_pwait with the last argument as NULL to achieve the same behavior. See here: https://android.googlesource.com/platform/bionic/+/master/libc/seccomp/arm64_app_policy.cpp https://android.googlesource.com/platform/bionic/+/master/libc/seccomp/mips64_app_policy.cpp https://android.googlesource.com/platform/bionic/+/master/libc/seccomp/x86_64_app_policy.cpp Fixes #23750 Change-Id: If8d5a663357471e5d2c1f516151344a9d05b188a Reviewed-on: https://go-review.googlesource.com/92895Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Yasuhiro Matsumoto authored
GitHub-Last-Rev: d6a6fa39095cac8a9acfeacbbafd636e1aa9b55b GitHub-Pull-Request: golang/go#23809 Change-Id: Ife18ba2f982b5e1c30bda32d13dcd441778b986a Reviewed-on: https://go-review.googlesource.com/93575Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Andrew Bonventre authored
Adds a function that returns an OS-dependent location for user-specific cache data. Fixes golang/go#22536 Change-Id: Ifff015452494571ad357fa2d945d66a5992c751d Reviewed-on: https://go-review.googlesource.com/78835 Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
This file wasn't supposed to be checked in. Change-Id: Ib0db0a330a3e030b0e6e5fde12088df5ac610ebc Reviewed-on: https://go-review.googlesource.com/93555Reviewed-by: Dave Cheney <dave@cheney.net> Reviewed-by: Andrew Bonventre <andybons@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Rob Pike authored
Was missing a check in validSymbol. Fixes #23580. Can wait for go1.11. Probably safe but the crash is only for invalid input, so not worth the risk. Change-Id: I51f88c5be35a8880536147d1fe5c5dd6798c29de Reviewed-on: https://go-review.googlesource.com/90398Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Mark Rushakoff authored
Change-Id: I426310e0c05c2b4a0123299ade0fe11721d40b10 GitHub-Last-Rev: 651c0291d6f2561e3e179a0b97e0e73ac6d21e2f GitHub-Pull-Request: golang/go#23801 Reviewed-on: https://go-review.googlesource.com/93475Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Daniel Martí authored
Inconsistent names are quite obvious on the godoc HTML rendering: type Array func NewArray(elem Type, len int64) *Array func (a *Array) Elem() Type func (a *Array) Len() int64 func (t *Array) String() string func (t *Array) Underlying() Type Fix all the String and Underlying methods to be consistent with their types. This makes these two lists of methods less consistent, but that's not visible to the user. This also makes the inconsistent receiver names rule in golint happy. Change-Id: I7c84d6bae1235887233a70d5f7f61a224106e952 Reviewed-on: https://go-review.googlesource.com/91736Reviewed-by: Robert Griesemer <gri@golang.org>
-
- 12 Feb, 2018 22 commits
-
-
Robert Griesemer authored
R=go1.11. Now that we have a syntax error test harness, we can add the proper tests for the recent parser fixes. For #20800. For #20789. For #23385. For #23434. A test for #20789 already exists in test/fixedbugs, but this is the better location for that test. But leaving the existing one where it is as well. Change-Id: I5937b9b63bafd1efab467a00344302e717976171 Reviewed-on: https://go-review.googlesource.com/88336Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Robert Griesemer authored
R=go1.11 Fixes #20800. Change-Id: Ifea273521d42a543a43da2f655ace7c295650e30 Reviewed-on: https://go-review.googlesource.com/88335Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Robert Griesemer authored
R=go1.11 In order to collect comments in the AST and for error testing purposes, the scanner needs to not only recognize and skip comments, but also be able to report them if so desired. This change adds a mode flag to the scanner's init function which controls the scanner behavior around comments. In the common case where comments are not needed, there must be no significant overhead. Thus, comments are reported via a handler upcall rather than being returned as a _Comment token (which the parser would have to filter out with every scanner.next() call). Because the handlers for error messages, directives, and comments all look the same (they take a position and text), and because directives look like comments, and errors never start with a '/', this change simplifies the scanner's init call to only take one (error) handler instead of 2 or 3 different handlers with identical signature. It is trivial in the handler to determine if we have an error, directive, or general comment. Finally, because directives are comments, when reporting directives the full comment text is returned now rather than just the directive text. This simplifies the implementation and makes the scanner API more regular. Furthermore, it provides important information about the comment style used by a directive, which may matter eventually when we fully implement /*line file:line:col*/ directives. Change-Id: I2adbfcebecd615e4237ed3a832b6ceb9518bf09c Reviewed-on: https://go-review.googlesource.com/88215Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Robert Griesemer authored
R=go1.11. This is just a copy of the fix for #23434: https://go-review.googlesource.com/c/go/+/87898. Test pending test harness for the syntax package. Change-Id: I52409aebe13ec784ddd7e41190a81c7e126bdd0c Reviewed-on: https://go-review.googlesource.com/87901Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Robert Griesemer authored
R=go1.11 A common error is to write '=' instead of '==' inside the condition of a simple 'if' statement: if x = 0 { ... } Highlight the fact that we have an assignment in the error message to prevent further confusion. Fixes #23385. Change-Id: I1552050fd6da927bd12a1be0977bd2e98eca5885 Reviewed-on: https://go-review.googlesource.com/87316Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Robert Griesemer authored
R=go1.11 This implements parsing of /*line file:line*/ and /*line file:line:col*/ directives and also extends the optional column format to regular //line directives, per #22662. For a line directive to be recognized, its comment text must start with the prefix "line " which is followed by one of the following: :line :line:col filename:line filename:line:col with at least one : present. The line and col values must be unsigned decimal integers; everything before is considered part of the filename. Valid line directives are: //line :123 //line :123:8 //line foo.go:123 //line C:foo.go:123 (filename is "C:foo.go") //line C:foo.go:123:8 (filename is "C:foo.go") /*line ::123*/ (filename is ":") No matter the comment format, at the moment all directives act as if they were in //line comments, and column information is ignored. To be addressed in subsequent CLs. For #22662. Change-Id: I1a2dc54bacc94bc6cdedc5229ee13278971f314e Reviewed-on: https://go-review.googlesource.com/86037Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Robert Griesemer authored
R=go1.11 Also: Minor updates to syntax.Parse doc string. Change-Id: I649965be9670a2f1c3de2cdb350634ed21e36ad9 Reviewed-on: https://go-review.googlesource.com/85663Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Robert Griesemer authored
R=go1.11 This is a follow up for #11377 which reported that an error like /tmp/xx.go:9:6: expected '(', found 'IDENT' F1 shouldn't print 'IDENT', as it's just an internal detail. The relevant change wasn't made in the original fix, so here it is. For #11377. Change-Id: Ib76957d86b88e3e63646fbe4abf03a3b9d045139 Reviewed-on: https://go-review.googlesource.com/87900Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Robert Griesemer authored
R=go1.11 No semantic change. For #23434. Change-Id: Iafdb062b0ebe6cd6e51f9a98b62b1d10f1bacc5c Reviewed-on: https://go-review.googlesource.com/87899Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Robert Griesemer authored
R=go1.11 This CL also introduces a new TODO in parser.go. To be addressed in a separate CL to make this easier to review. Also: Make parser's test harness easier to use by ignoring auto-inserted (invisible) semicolons when computing error positions. Adjusted testdata/commas.src accordingly. Fixes #23434. Change-Id: I050592d11d5f984f71185548394c000eea509205 Reviewed-on: https://go-review.googlesource.com/87898Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Robert Griesemer authored
For consistent formatting across platforms we strip \r's from comments. This happens in the go/scanner which already does this for raw string literals where it is mandated by the spec. But if a (sequence of) \r appears in a regular (/*-style) comment between a * and a /, removing that (sequence of) \r shortens that text segment to */ which terminates the comment prematurely. Don't do it. As an aside, a better approach would be to not touch comments, (and raw string literals for that matter) in the scanner and leave the extra processing to clients. That is the approach taken by the cmd/compile/internal/syntax package. However, we probably can't change the semantics here too much, so just do the minimal change that doesn't produce invalid comments. It's an esoteric case after all. Fixes #11151. Change-Id: Ib4dcb52094f13c235e840c9672e439ea65fef961 Reviewed-on: https://go-review.googlesource.com/87498Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Robert Griesemer authored
R=go1.11 To fix this, this CL borrows code from the new syntax package which has a better tuned parser at this point. Fixes #11377. Change-Id: Ib9212c945903d6f62abcc59ef5a5767d4ef36981 Reviewed-on: https://go-review.googlesource.com/87495Reviewed-by: Matthew Dempsky <mdempsky@google.com>
-
Robert Griesemer authored
ioutil.ReadAll didn't exist when we wrote that parser code originally (in 2009). Now it does, so use it. This may also make that code path slightly more efficient. Also, now that we are guaranteed to have a fast path for reading from an io.Reader (and thus an io.ReadCloser), simplify setup code for parser.ParseFile calls in srcimporter.Importer.ParseFiles. Remove the associated TODO since we cannot reproduce any significant performance differences when running go test -run ImportStdLib for the case where we used to read directly from a file (even before the change to the parser). Fixes #19281. Change-Id: I816459d092bb9e27fdc85089b8f21d57ec3fd79a Reviewed-on: https://go-review.googlesource.com/85395Reviewed-by: Alan Donovan <adonovan@google.com>
-
Robert Griesemer authored
R=go1.11 Once approved, this change must be ported to golang.org/x/tools/go/gcimporter15. Fixes #13829. Change-Id: I26a0094d2bfd38b97f2b64bae84b9f428fc9cdf1 Reviewed-on: https://go-review.googlesource.com/85318Reviewed-by: Alan Donovan <adonovan@google.com>
-
Austin Clements authored
CL 137410043 deleted support for split stacks, which means morestack no longer needed to save its caller's frame or argument size or its caller's argument pointer. However, this commit failed to update the comment or delete the line that computed the caller's argument pointer. Clean these up now. Change-Id: I65725d3d42c86e8adb6645d5aa80c305d473363d Reviewed-on: https://go-review.googlesource.com/92437 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Austin Clements authored
This replaces frame size -4/-8 with the NOFRAME flag in mips and mips64 assembly. This was automated with: sed -i -e 's/\(^TEXT.*[A-Z]\),\( *\)\$-[84]/\1|NOFRAME,\2$0/' $(find -name '*_mips*.s') Plus a manual fix to mkduff.go. The go binary is identical on both architectures before and after this change. Change-Id: I0310384d1a584118c41d1cd3a042bb8ea7227efb Reviewed-on: https://go-review.googlesource.com/92044 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Austin Clements authored
This replaces frame size -8 with the NOFRAME flag in arm64 assembly. This was automated with: sed -i -e 's/\(^TEXT.*[A-Z]\),\( *\)\$-8/\1|NOFRAME,\2$0/' $(find -name '*_arm64.s') Plus a manual fix to mkduff.go. The go binary is identical before and after this change. Change-Id: I0310384d1a584118c41d1cd3a042bb8ea7227efa Reviewed-on: https://go-review.googlesource.com/92043 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Austin Clements authored
This replaces frame size -4 with the NOFRAME flag in arm assembly. This was automated with: sed -i -e 's/\(^TEXT.*[A-Z]\),\( *\)\$-4/\1|NOFRAME,\2$0/' $(find -name '*_arm.s') Plus three manual comment changes found by: grep '\$-4' $(find -name '*_arm.s') The go binary is identical before and after this change. Change-Id: I0310384d1a584118c41d1cd3a042bb8ea7227ef9 Reviewed-on: https://go-review.googlesource.com/92042 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Austin Clements authored
Change-Id: I3f71228e391f122f9cc5656ca6835fdf51a424b7 Reviewed-on: https://go-review.googlesource.com/92435 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Austin Clements authored
This passes toolstash -cmp with one exception: assembly functions that were declared with a frame size of -4 (or -8) used to record locals=0xfffffffffffffffc in the object file and now record locals=0x0. This doesn't affect anything. Change-Id: I0d15e81770e54222ae329ce4496da06016736771 Reviewed-on: https://go-review.googlesource.com/92041 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Austin Clements authored
In addition, this makes the arm64 prologue code generation much closer to the pattern used on other platforms. This passes toolstash -cmp with one exception: assembly functions that were declared with a frame size of -8 used to record locals=0xfffffffffffffff8 in the object file and now record locals=0x0. This doesn't affect anything. Change-Id: I0d15e81770e54222ae329ce4496da06016736770 Reviewed-on: https://go-review.googlesource.com/92040 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Austin Clements authored
This adds support on arm for the NOFRAME symbol attribute used by ppc64 and s390x in preference to using a frame size of -4. This is modeled on ppc64's implementation of NOFRAME. This passes toolstash -cmp. Change-Id: I0d15e81770e54222ae329ce4496da0601673677f Reviewed-on: https://go-review.googlesource.com/92039 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-