1. 11 Nov, 2011 1 commit
    • Russ Cox's avatar
      godefs: delete, replaced by cgo -godefs · 879a1c6a
      Russ Cox authored
      Godefs was a C program that ran gcc and then parsed the
      stabs debugging information in the resulting object file to
      generate C or Go code for bootstrapping as part of
      package runtime or package syscall.
      
      Cgo does the same work, but using the dwarf debugging
      information.  Add -godefs and -cdefs options to cgo that
      mimic godefs's output, albeit with different input
      (a Go program, not a C program).
      
      This has been a "nice to have" for a while but was forced
      by Apple removing stabs debugging output from their
      latest compilers.
      
      Fixes #835.
      Fixes #2338.
      
      R=golang-dev, bradfitz, r, dave, iant
      CC=golang-dev
      https://golang.org/cl/5367043
      879a1c6a
  2. 09 Nov, 2011 1 commit
  3. 02 Nov, 2011 1 commit
  4. 26 Oct, 2011 1 commit
  5. 18 Oct, 2011 1 commit
  6. 04 Oct, 2011 1 commit
  7. 19 Sep, 2011 1 commit
  8. 28 Jul, 2011 1 commit
  9. 27 Jun, 2011 1 commit
  10. 22 Jun, 2011 1 commit
    • Robert Griesemer's avatar
      os.Error API: don't export os.ErrorString, use os.NewError consistently · 712fb6dc
      Robert Griesemer authored
      This is a core API change.
      
      1) gofix misc src
      2) Manual adjustments to the following files under src/pkg:
         gob/decode.go
         rpc/client.go
         os/error.go
         io/io.go
         bufio/bufio.go
         http/request.go
         websocket/client.go
      as well as:
         src/cmd/gofix/testdata/*.go.in (reverted)
         test/fixedbugs/bug243.go
      3) Implemented gofix patch (oserrorstring.go) and test case (oserrorstring_test.go)
      
      Compiles and runs all tests.
      
      R=r, rsc, gri
      CC=golang-dev
      https://golang.org/cl/4607052
      712fb6dc
  11. 17 Jun, 2011 1 commit
  12. 13 Jun, 2011 1 commit
  13. 07 Jun, 2011 1 commit
  14. 27 May, 2011 2 commits
  15. 06 May, 2011 1 commit
  16. 13 Apr, 2011 1 commit
  17. 28 Mar, 2011 1 commit
  18. 06 Mar, 2011 1 commit
    • Gustavo Niemeyer's avatar
      cgo: fix dwarf type parsing · 99686ec7
      Gustavo Niemeyer authored
      The recursive algorithm used to parse types in cgo
      has a bug related to building the C type representation.
      
      As an example, when the recursion starts at a type *T,
      the C type representation won't be known until type T
      itself is parsed.  But then, it is possible that type T
      references the type **T internally.  The latter
      representation is built based on the one of *T, which
      started the recursion, so it won't attempt to parse it
      again, and will instead use the current representation
      value for *T, which is still empty at this point.
      
      This problem was fixed by introducing a simple TypeRepr
      type which builds the string representation lazily,
      analogous to how the Go type information is built within
      the same algorithm.  This way, even if a type
      representation is still unknown at some level in the
      recursion, representations dependant on it can still
      be created correctly.
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/4244052
      99686ec7
  19. 02 Mar, 2011 1 commit
  20. 09 Feb, 2011 1 commit
    • Gustavo Niemeyer's avatar
      cgo: fix handling of signed enumerations · 45217825
      Gustavo Niemeyer authored
      Structs defined in C as containing a field with
      an enum type are currently translated to Go as
      a struct with an unsigned integer field, even if
      some of the values contained in the enum are
      negative.
      
      This modification takes in consideration the values
      defined in the enum, and conditionally defines the
      Go type as signed if necessary.
      
      The logic introduced was tested with gcc, which
      will increase the type size if it contains both
      negative numbers and values greater than 2^b/2-1,
      and refuses to compile values which would be
      problematic (2^64-1, but in fact the ISO C
      restricts the range to the size of int).
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/4119058
      45217825
  21. 03 Feb, 2011 1 commit
  22. 02 Feb, 2011 1 commit
  23. 01 Feb, 2011 1 commit
  24. 31 Jan, 2011 1 commit
    • Roger Peppe's avatar
      cgo: improve error reporting slightly. · 76130bde
      Roger Peppe authored
      If there were warnings or errors in the user code,
      cgo would print the first error from gcc and then stop,
      which is not helpful.
      This CL makes cgo ignore errors from user code
      in the first pass - they will be shown later.
      It also prints errors from user preamble code
      with the correct line numbers.
      (Also fixed misleading usage message).
      
      R=iant, rsc
      CC=golang-dev
      https://golang.org/cl/4082047
      76130bde
  25. 19 Jan, 2011 1 commit
  26. 11 Jan, 2011 1 commit
  27. 17 Dec, 2010 1 commit
    • Russ Cox's avatar
      misc/cgo/life: fix, add to build · 0cd34753
      Russ Cox authored
      #pragma dynexport is no longer needed for
      this use of cgo, since the gcc and gc code are
      now linked together into the same binary.
      It may still be necessary later.
      
      On the Mac, you cannot use the GOT to resolve
      symbols that exist in the current binary, so 6l and 8l
      translate the GOT-loading mov instructions into lea
      instructions.
      
      On ELF systems, we could use the GOT for those
      symbols, but for consistency 6l and 8l apply the
      same translation.
      
      The translation is sketchy in the extreme
      (depending on the relocation being in a mov
      instruction) but it verifies that the instruction
      is a mov before rewriting it to lea.
      
      Also makes typedefs global across files.
      
      Fixes #1335.
      Fixes #1345.
      
      R=iant, r
      CC=golang-dev
      https://golang.org/cl/3650042
      0cd34753
  28. 13 Dec, 2010 1 commit
  29. 06 Dec, 2010 1 commit
    • Robert Griesemer's avatar
      go/ast: use token.Pos instead of token.Position; adjust all dependent code · 5a9ad8b9
      Robert Griesemer authored
      	Specifically:
      
      	* lib/godoc:
      	- provide file set (FSet) argument to formatters where needed
      
      	* src/cmd:
      	- cgo, ebnflint, godoc, gofmt, goinstall: provide file set (fset) where needed
      	- godoc: remove local binary search with sort.Search (change by rsc),
      	  extract file set for formatters
      
      	* src/pkg:
      	- exp/eval: remove embedded token.Position fields from nodes and replace
      	  with named token.Pos fields; add corresponding Pos() accessor methods
      	- go/token: added file.Line(), changed signature of File.Position()
      
      	* test/fixedbugs/:
      	- bug206.go: change test to not rely on token.Pos details
      
      	* added various extra comments
      	* Runs all.bash
      	* gofmt formats all of src, misc w/o changes
      	* godoc runs
      
      	* performance:
      	- The new version of godoc consumes about the same space after indexing
      	  has completed, but indexing is half the speed. Significant space savings
      	  are expected from smaller ASTs, but since they are thrown away after a
      	  file has been indexed, this is not visible anymore. The slower indexing
      	  time is due to the much more expensive computation of line information.
      	  However, with the new compressed position information, indexing can be
      	  rewritten and simplified. Furthermore, computing the line info can be
      	  done more efficiently.
      
              New godoc, immediately after indexing completed (best of three runs):
      
      	  PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE  VSIZE
      	44381 godoc        0.0%  0:38.00   4    19    149  145M   184K   148M   176M
      
      	2010/12/03 17:58:35 index updated (39.231s, 18505 unique words, 386387 spots)
      	2010/12/03 17:58:35 bytes=90858456 footprint=199182584
      	2010/12/03 17:58:36 bytes=47858568 footprint=167295224
      
      	Old godoc, immediately after indexing completed (best of three runs):
      
      	  PID COMMAND      %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD  RSIZE  VSIZE
      	23167 godoc        0.0%  0:22.02   4    17    132  129M   184K   132M   173M
      
      	2010/12/03 14:51:32 index updated (24.892s, 18765 unique words, 393830 spots)
      	2010/12/03 14:51:32 bytes=66404528 footprint=163907832
      	2010/12/03 14:51:32 bytes=46282224 footprint=163907832
      
      	The different numbers for unique words/spots stem from the fact the the
      	two workspaces are not exactly identical. The new godoc maintains a large
      	file set data structure during indexing which (probably) is the reason
      	for the larger heap (90858456 vs 66404528) before garbage collection.
      
      R=rsc, r
      CC=golang-dev
      https://golang.org/cl/3050041
      5a9ad8b9
  30. 01 Nov, 2010 2 commits
  31. 28 Oct, 2010 1 commit
  32. 16 Sep, 2010 1 commit
  33. 18 Aug, 2010 1 commit
  34. 13 Aug, 2010 1 commit
    • Robert Griesemer's avatar
      go AST: First step towards augmenting AST with full type information. · 1f9dfa29
      Robert Griesemer authored
      - change ast.Ident back to contain the name and adjust all dependent code
      - identifier object information will be added again through an optional
        typechecker phase (in the works).
      - remove tracking of scopes in parser - it's easier to do this in a separate
        phase (in the works)
      - in godoc, generate popup info table directly instead of through a formatter
        for simpler data flow (at the expense of a little bit more code)
      
      Runs all tests.
      
      As a result of this change, the currently shown popup information
      (const, var, type, func, followed by identifier name) will not be
      shown anymore temporarily.
      
      R=rsc
      CC=golang-dev
      https://golang.org/cl/1994041
      1f9dfa29
  35. 05 Aug, 2010 1 commit
  36. 16 Jul, 2010 1 commit
  37. 15 Jul, 2010 1 commit
    • Russ Cox's avatar
      cgo: various bug fixes · 0432f289
      Russ Cox authored
      * remember #defined names, so that C.stdout can refer
        to the real name (on OS X) __stdoutp.
      * better handling of #defined constant expressions
      * allow n, err = C.strtol("asdf", 0, 123) to get errno as os.Error
      * write all output files to current directory
      * don't require gcc output if there was no input
      
      Fixes #533.
      Fixes #709.
      Fixes #756.
      
      R=r
      CC=dho, golang-dev, iant
      https://golang.org/cl/1734047
      0432f289
  38. 01 Jul, 2010 1 commit