1. 11 Nov, 2014 4 commits
    • Russ Cox's avatar
      [dev.cc] cmd/gc: changes for removing runtime C code · fd2bc95d
      Russ Cox authored
      [This CL is part of the removal of C code from package runtime.
      See golang.org/s/dev.cc for an overview.]
      
      export.c, lex.c:
      Add -asmhdr flag to write assembly header file with struct
      field offsets and const values. cmd/dist used to construct this
      file by interpreting output from the C compiler.
      Generate it from the Go definitions instead.
      Also, generate the form we need directly, instead of relying
      on cmd/dist for reprocessing.
      
      lex.c, obj.c:
      If the C compiler accepted #pragma cgo_xxx, recognize
      a directive //go:cgo_xxx instead. The effect is the same as
      in the C compiler: accumulate text into a buffer and emit in the
      output file, where the linker will find and use it.
      
      lex.c, obj.c:
      Accept //go:linkname to control the external symbol name
      used for a particular top-level Go variable. This makes it
      possible to refer to C symbol names but also symbols from
      other packages. It has always been possible to do this from
      C and assembly. To drive home the point that this should not
      be done lightly, require import "unsafe" in any file containing
      //go:linkname.
      
      plive.c, reflect.c, subr.c:
      Hard-code that interfaces contain only pointers.
      This means code handling multiword values in the garbage
      collector and the stack copier can be deleted instead of being
      converted. This change is already present in the dev.garbage
      branch.
      
      LGTM=r
      R=r
      CC=austin, golang-codereviews, iant, khr
      https://golang.org/cl/169360043
      fd2bc95d
    • Russ Cox's avatar
      [dev.cc] cmd/cgo: generate only Go source files · 25f9f5d0
      Russ Cox authored
      [This CL is part of the removal of C code from package runtime.
      See golang.org/s/dev.cc for an overview.]
      
      We changed cgo to write the actual function wrappers in Go
      for Go 1.4. The only code left in C output files was the definitions
      for pointers to C data and the #pragma cgo directives.
      Write both of those to Go outputs instead, using the new
      compiler directives introduced in CL 169360043.
      
      (Still generating C files in gccgo mode.)
      
      LGTM=r
      R=r
      CC=austin, golang-codereviews, iant, khr
      https://golang.org/cl/169330045
      25f9f5d0
    • Russ Cox's avatar
      [dev.cc] reflect: interfaces contain only pointers · 33e91029
      Russ Cox authored
      [This CL is part of the removal of C code from package runtime.
      See golang.org/s/dev.cc for an overview.]
      
      Adjustments for changes made in CL 169360043.
      This change is already present in the dev.garbage branch.
      
      LGTM=r
      R=r
      CC=austin, golang-codereviews, iant, khr
      https://golang.org/cl/167520044
      33e91029
    • Russ Cox's avatar
      [dev.cc] cmd/5c, cmd/6c, cmd/8c, cmd/cc: remove · 4a42fae2
      Russ Cox authored
      Let's just do this up front.
      This will break the build (here on the dev.cc branch).
      The CLs that follow will take care of fixing it.
      
      Leave behind cmd/cc/lexbody and cmd/cc/macbody for the assemblers.
      They'll go away later.
      
      LGTM=dave, r
      R=r, dave
      CC=golang-codereviews
      https://golang.org/cl/172170043
      4a42fae2
  2. 10 Nov, 2014 7 commits
  3. 09 Nov, 2014 7 commits
  4. 08 Nov, 2014 1 commit
  5. 07 Nov, 2014 3 commits
  6. 06 Nov, 2014 11 commits
  7. 05 Nov, 2014 2 commits
  8. 04 Nov, 2014 2 commits
    • Ian Lance Taylor's avatar
      test: comment out failing cases from sinit.go · c6e53fea
      Ian Lance Taylor authored
      One failing case this removes is:
      
      var bytes = []byte("hello, world")
      var copy_bytes = bytes
      
      We could handle this in the compiler, but it requires special
      case for a variable that is initialized to the value of a
      variable that is initialized to a string literal converted to
      []byte.  This seems an unlikely case--it never occurs in the
      standrd library--and it seems unnecessary to write the code to
      handle it.
      
      If we do want to support this case, one approach is
      https://golang.org/cl/171840043.
      
      The other failing cases are of the form
      
      var bx bool
      var copy_bx = bx
      
      The compiler used to initialize copy_bx to false.  However,
      that led to issue 7665, since bx may be initialized in non-Go
      code.  The compiler no longer assumes that bx must be false,
      so copy_bx can not be statically initialized.
      
      We can fix these with https://golang.org/cl/169040043
      if we also pass -complete to the compiler as part of this
      test.  This is OK but it's too late in the release cycle.
      
      Fixes #8746.
      
      LGTM=rsc
      R=rsc
      CC=golang-codereviews
      https://golang.org/cl/165400043
      c6e53fea
    • Austin Clements's avatar
      gc: abort if given an unknown debug (-d) flag · 516d9ef5
      Austin Clements authored
      The check for unknown command line debug flags in gc was
      incorrect: the loop over debugtab terminates when it reaches a
      nil entry, but it was only reporting an error if the parser
      had passed the last entry of debugtab (which it never did).
      Fix this by reporting the usage error if the loop reaches a
      nil entry.
      
      LGTM=rsc
      R=rsc
      CC=golang-codereviews
      https://golang.org/cl/166110043
      516d9ef5
  9. 03 Nov, 2014 3 commits