mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.regabi] cmd/compile: type check externdcl earlier
The next CL requires externdcl to be type checked earlier, but this causes toolstash -cmp to complain because it causes src.PosBases to get added in a different order. So split out into a separate CL. Change-Id: Icab4eadd3fa8acffbd3e980bd8100924378351b3 Reviewed-on: https://go-review.googlesource.com/c/go/+/277732 Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
9f16620f46
commit
305d93ef84
1 changed files with 12 additions and 15 deletions
|
|
@ -282,9 +282,18 @@ func Main(archInit func(*Arch)) {
|
||||||
fcount++
|
fcount++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// With all types checked, it's now safe to verify map keys. One single
|
|
||||||
// check past phase 9 isn't sufficient, as we may exit with other errors
|
// Phase 3.11: Check external declarations.
|
||||||
// before then, thus skipping map key errors.
|
// TODO(mdempsky): This should be handled when type checking their
|
||||||
|
// corresponding ODCL nodes.
|
||||||
|
timings.Start("fe", "typecheck", "externdcls")
|
||||||
|
for i, n := range externdcl {
|
||||||
|
if n.Op() == ir.ONAME {
|
||||||
|
externdcl[i] = typecheck(externdcl[i], ctxExpr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Phase 3.14: With all user code type-checked, it's now safe to verify map keys.
|
||||||
checkMapKeys()
|
checkMapKeys()
|
||||||
base.ExitIfErrors()
|
base.ExitIfErrors()
|
||||||
|
|
||||||
|
|
@ -418,18 +427,6 @@ func Main(archInit func(*Arch)) {
|
||||||
base.Flag.GenDwarfInl = 0
|
base.Flag.GenDwarfInl = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// Phase 9: Check external declarations.
|
|
||||||
timings.Start("be", "externaldcls")
|
|
||||||
for i, n := range externdcl {
|
|
||||||
if n.Op() == ir.ONAME {
|
|
||||||
externdcl[i] = typecheck(externdcl[i], ctxExpr)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Check the map keys again, since we typechecked the external
|
|
||||||
// declarations.
|
|
||||||
checkMapKeys()
|
|
||||||
base.ExitIfErrors()
|
|
||||||
|
|
||||||
// Write object data to disk.
|
// Write object data to disk.
|
||||||
timings.Start("be", "dumpobj")
|
timings.Start("be", "dumpobj")
|
||||||
dumpdata()
|
dumpdata()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue