]> Cypherpunks.ru repositories - gostls13.git/commitdiff
[dev.typeparams] all: merge dev.regabi (5e4a0cd) into dev.typeparams
authorMatthew Dempsky <mdempsky@google.com>
Tue, 26 Jan 2021 01:53:08 +0000 (17:53 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 26 Jan 2021 01:53:50 +0000 (17:53 -0800)
Merge List:

+ 2021-01-25 5e4a0cdde3 [dev.regabi] all: merge master (bf0f7c9) into dev.regabi
+ 2021-01-25 bf0f7c9d78 doc/go1.16: mention os.DirFS in os section
+ 2021-01-25 deaf29a8a8 cmd/compile: fix order-of-assignment issue w/ defers
+ 2021-01-25 ad2ca26a52 doc/go1.16: mention os.DirEntry and types moved from os to io/fs
+ 2021-01-25 a51921fa5b doc/go1.16: mention new testing/iotest functions
+ 2021-01-25 e6b6d107f7 doc/go1.16: mention deprecation of io/ioutil
+ 2021-01-25 7eaaf28cae [dev.regabi] cmd/compile: disallow taking address of SSA'd values
+ 2021-01-25 96a276363b doc/go1.16: mention go/build changes
+ 2021-01-25 3d85c69a0b html/template: revert "avoid race when escaping updates template"
+ 2021-01-25 54514c6b28 cmd/go: fix TestScript/cgo_path, cgo_path_space when CC set
+ 2021-01-25 6f5e79f470 [dev.regabi] cmd/compile/internal: specify memory layout
+ 2021-01-25 cabffc199d [dev.regabi] cmd/compile/internal: add internal ABI specification
+ 2021-01-25 6de8443f3b doc/asm: add a section on go_asm.h, clean up go_tls.h section
+ 2021-01-25 6a4739ccc5 [dev.regabi] cmd/compile: enable rational constant arithmetic
+ 2021-01-25 be9612a832 [dev.regabi] os: disable TestDirFS until #42637 is fixed
+ 2021-01-25 8ee3d39838 [dev.regabi] cmd/go: workaround -race issue on ppc64le
+ 2021-01-25 54b251f542 lib/time, time/tzdata: update tzdata to 2021a
+ 2021-01-25 5a76c3d548 [dev.regabi] cmd/compile: modify abiutils for recently updated ABI
+ 2021-01-25 ff82cc971a os: force consistent mtime before running fstest on directory on Windows
+ 2021-01-25 044f937a73 doc/go1.16: fix WalkDir and Walk links
+ 2021-01-23 b634f5d97a doc/go1.16: add crypto/x509 memory optimization
+ 2021-01-23 9897655c61 doc/go1.16: reword ambiguously parsable sentence
+ 2021-01-23 cd99385ff4 cmd/internal/obj/arm64: fix VMOVQ instruction encoding error
+ 2021-01-23 66ee8b158f runtime: restore cgo_import_dynamic for libc.so on openbsd
+ 2021-01-22 25c39e4fb5 io/ioutil: fix example test for WriteFile to allow it to run in the playground
+ 2021-01-22 eb21b31e48 runtime: define dummy msanmove
+ 2021-01-22 3a778ff50f runtime: check for g0 stack last in signal handler
+ 2021-01-22 a2cef9b544 cmd/go: don't lookup the path for CC when invoking cgo

Change-Id: Iede4f98ba5ddbee2e16075d20186f8a9c095e378

1  2 
src/cmd/compile/internal/noder/noder.go

index 887205b9fb0b9bcf1259368ecb05408c166961d8,5b5b09cb2df930a0055fa89fd3db023b3ef3b2b1..1c38f1a934d0b71c3256bfb7f45a72fde9cfbac5
@@@ -30,9 -30,6 +30,9 @@@ func LoadPackage(filenames []string) 
        base.Timer.Start("fe", "parse")
  
        mode := syntax.CheckBranches
 +      if base.Flag.G != 0 {
 +              mode |= syntax.AllowGenerics
 +      }
  
        // Limit the number of simultaneously open files.
        sem := make(chan struct{}, runtime.GOMAXPROCS(0)+10)
                for e := range p.err {
                        p.errorAt(e.Pos, "%s", e.Msg)
                }
 -              lines += p.file.Lines
 +              lines += p.file.EOF.Line()
        }
        base.Timer.AddEvent(int64(lines), "lines")
  
 +      if base.Flag.G != 0 {
 +              // Use types2 to type-check and possibly generate IR.
 +              check2(noders)
 +              return
 +      }
 +
        for _, p := range noders {
                p.node()
                p.file = nil // release memory
@@@ -1040,7 -1031,8 +1040,7 @@@ func (p *noder) stmtFall(stmt syntax.St
        case *syntax.DeclStmt:
                return ir.NewBlockStmt(src.NoXPos, p.decls(stmt.DeclList))
        case *syntax.AssignStmt:
 -              if stmt.Rhs == syntax.ImplicitOne {
 -                      one := constant.MakeInt64(1)
 +              if stmt.Rhs == nil {
                        pos := p.pos(stmt)
                        n := ir.NewAssignOpStmt(pos, p.binOp(stmt.Op), p.expr(stmt.Lhs), ir.NewBasicLit(pos, one))
                        n.IncDec = true
@@@ -1463,14 -1455,6 +1463,6 @@@ func (p *noder) basicLit(lit *syntax.Ba
                p.errorAt(lit.Pos(), "malformed constant: %s", lit.Value)
        }
  
-       // go/constant uses big.Rat by default, which is more precise, but
-       // causes toolstash -cmp and some tests to fail. For now, convert
-       // to big.Float to match cmd/compile's historical precision.
-       // TODO(mdempsky): Remove.
-       if v.Kind() == constant.Float {
-               v = constant.Make(ir.BigFloat(v))
-       }
        return v
  }