From: Russ Cox Date: Tue, 22 Dec 2020 22:08:15 +0000 (-0500) Subject: [dev.typeparams] all: merge dev.regabi (ec741b0) into dev.typeparams X-Git-Tag: go1.17beta1~1473^2~136 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=91cc51e0053b6ed6ab096c949f46364002b54be1;p=gostls13.git [dev.typeparams] all: merge dev.regabi (ec741b0) into dev.typeparams Conflicts: * src/cmd/compile/internal/gc/main.go Merge List: * 2020-12-22 ec741b0447 [dev.regabi] all: merge master (c9fb4eb) into dev.regabi * 2020-12-22 acc32ea124 [dev.regabi] codereview.cfg: add config for dev.regabi * 2020-12-22 c9fb4eb0a2 cmd/link: handle grouped resource sections * 2020-12-22 c40934b33d [dev.regabi] cmd/compile: adjust one case in walkexpr * 2020-12-22 280e7fd1ee [dev.regabi] cmd/compile: only access Func method on concrete types * 2020-12-22 51ba53f5c2 [dev.regabi] cmd/compile: separate misc for gc split * 2020-12-22 572f168ed2 [dev.regabi] cmd/compile: separate various from Main * 2020-12-22 3b12c6dc08 [dev.regabi] cmd/compile: separate typecheck more cleanly * 2020-12-22 7c8f5356ab [dev.regabi] cmd/compile: separate dowidth better * 2020-12-22 c06a354bcc test: trigger SIGSEGV instead of SIGTRAP in issue11656.go * 2020-12-22 0aa9b4709a cmd/pack: r command create output file if not exist * 2020-12-22 cb28c96be8 [dev.regabi] cmd/compile,cmd/link: initial support for ABI wrappers * 2020-12-22 c8610e4700 [dev.regabi] cmd/compile: add ir.BasicLit to represent literals * 2020-12-22 3512cde10a [dev.regabi] cmd/compile: stop reusing Ntype for OSLICELIT length * 2020-12-22 2755361e6a [dev.regabi] cmd/compile: change noder.declNames to returns ir.Names * 2020-12-22 301af2cb71 [dev.regabi] runtime/race: adjust test pattern match for ABI wrapper * 2020-12-22 4d27c4c223 runtime: correct error handling in several FreeBSD syscall wrappers * 2020-12-22 9b6147120a cmd/pack: treat compiler's -linkobj output as "compiler object" * 2020-12-22 306b2451c8 [dev.regabi] runtime: fix ABI targets in runtime.panic{Index,Slice} shims * 2020-12-21 bc7e4d9257 syscall: don't generate ptrace on iOS * 2020-12-21 94cfeca0a5 [dev.regabi] cmd/compile: stop using ONONAME with Name * 2020-12-21 cb4898a77d [dev.regabi] cmd/compile: simplify declaration importing * 2020-12-21 06915ac14d [dev.regabi] cmd/compile: move itabname call out of implements * 2020-12-21 6cff874c47 runtime/metrics: add Read examples * 2020-12-21 8438a5779b runtime: use _exit on darwin * 2020-12-21 cb95819cf6 runtime: detect netbsd netpoll overrun in sysmon * 2020-12-21 53c984d976 runtime: skip wakep call in wakeNetPoller on Plan 9 * 2020-12-21 9abbe27710 test: skip issue11656.go on mips/mips64/ppc64 Change-Id: Ia12a1892195f5e08bb41465374124c71a1a135f6 --- 91cc51e0053b6ed6ab096c949f46364002b54be1 diff --cc src/cmd/compile/internal/gc/main.go index ff5c208d02,94b4e0e674..b9454604f0 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@@ -228,84 -218,12 +218,18 @@@ func Main(archInit func(*Arch)) cgoSymABIs() timings.Stop() timings.AddEvent(int64(lines), "lines") + if base.Flag.G != 0 && base.Flag.G < 3 { + // can only parse generic code for now + base.ExitIfErrors() + return + } + - finishUniverse() - recordPackageName() - typecheckok = true - - // Process top-level declarations in phases. - - // Phase 1: const, type, and names and types of funcs. - // This will gather all the information about types - // and methods but doesn't depend on any of it. - // - // We also defer type alias declarations until phase 2 - // to avoid cycles like #18640. - // TODO(gri) Remove this again once we have a fix for #25838. - - // Don't use range--typecheck can add closures to Target.Decls. - timings.Start("fe", "typecheck", "top1") - for i := 0; i < len(Target.Decls); i++ { - n := Target.Decls[i] - if op := n.Op(); op != ir.ODCL && op != ir.OAS && op != ir.OAS2 && (op != ir.ODCLTYPE || !n.(*ir.Decl).Left().Name().Alias()) { - Target.Decls[i] = typecheck(n, ctxStmt) - } - } - - // Phase 2: Variable assignments. - // To check interface assignments, depends on phase 1. - - // Don't use range--typecheck can add closures to Target.Decls. - timings.Start("fe", "typecheck", "top2") - for i := 0; i < len(Target.Decls); i++ { - n := Target.Decls[i] - if op := n.Op(); op == ir.ODCL || op == ir.OAS || op == ir.OAS2 || op == ir.ODCLTYPE && n.(*ir.Decl).Left().Name().Alias() { - Target.Decls[i] = typecheck(n, ctxStmt) - } - } - - // Phase 3: Type check function bodies. - // Don't use range--typecheck can add closures to Target.Decls. - timings.Start("fe", "typecheck", "func") - var fcount int64 - for i := 0; i < len(Target.Decls); i++ { - n := Target.Decls[i] - if n.Op() == ir.ODCLFUNC { - Curfn = n.(*ir.Func) - decldepth = 1 - errorsBefore := base.Errors() - typecheckslice(Curfn.Body().Slice(), ctxStmt) - checkreturn(Curfn) - if base.Errors() > errorsBefore { - Curfn.PtrBody().Set(nil) // type errors; do not compile - } - // Now that we've checked whether n terminates, - // we can eliminate some obviously dead code. - deadcode(Curfn) - fcount++ - } - } + // Typecheck. + TypecheckPackage() - // Phase 3.11: Check external declarations. - // TODO(mdempsky): This should be handled when type checking their - // corresponding ODCL nodes. - timings.Start("fe", "typecheck", "externdcls") - for i, n := range Target.Externs { - if n.Op() == ir.ONAME { - Target.Externs[i] = typecheck(Target.Externs[i], ctxExpr) - } - } - - // Phase 3.14: With all user code type-checked, it's now safe to verify map keys - // and unused dot imports. - checkMapKeys() + // With all user code typechecked, it's now safe to verify unused dot imports. checkDotImports() base.ExitIfErrors()