Age | Commit message (Collapse) | Author |
|
After using the IR visitor code for a bit, it seems clear that a
simple boolean result type is adequate for tree traversals. This CL
updates ir.DoChildren to use the same calling convention as ir.Any,
and updates mknode.go to generate code accordingly.
There were only two places where the error-based DoChildren API was
used within the compiler:
1. Within typechecking, marking statements that contain "break". This
code never returns errors anyway, so it's trivially updated to return
false instead.
2. Within inlining, the "hairy visitor" actually does make use of
returning errors. However, it threads through a reference to the
hairyVisitor anyway, where it would be trivial to store any needed
information instead. For the purpose of this CL, we provide
"errChildren" and "errList" helper functions that provide the previous
error-based semantics on top of the new bool-based API.
Passes toolstash -cmp.
Change-Id: I4bac9a697b4dbfb5f66eeac37d4a2ced2073d7d0
Reviewed-on: https://go-review.googlesource.com/c/go/+/280675
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
|
|
Passes toolstash -cmp.
Change-Id: I505577d067eda3512f6d78618fc0eff061a71e3c
Reviewed-on: https://go-review.googlesource.com/c/go/+/280732
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
|
|
typechecker
This CL computes a second parallel addrtaken bit that we check
against the old way of doing it. A subsequent CL will rip out the
typechecker code and just use the new way.
Change-Id: I62b7342c44f694144844695386f80088bbd40bf4
Reviewed-on: https://go-review.googlesource.com/c/go/+/275695
Trust: Keith Randall <khr@golang.org>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
|
|
Currently, the tcArith logic is complicated and involes many
un-necessary checks for some ir.Op. This CL refactors how it works:
- Add a new tcShiftOp function, which only does necessary works for
typechecking OLSH/ORSH. That ends up moving OLSH/ORSH to a separated
case in typecheck1.
- Move OASOP to separated case, so its logic is detached from tcArith.
- Move OANDAND/OOROR to separated case, which does some validation
dedicated to logical operators only.
Passes toolstash -cmp.
Change-Id: I0db7b7c7a3e52d6f9e9d87eee6967871f1c32200
Reviewed-on: https://go-review.googlesource.com/c/go/+/279442
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
|
|
These three expression nodes all represent the same syntax, and so
they're represented the same within types2. And also they're not
handled that meaningfully differently throughout the rest of the
compiler to merit unique representations.
Method expressions are somewhat unique today that they're very
frequently turned into plain function names. But eventually that can
be handled by a post-typecheck desugaring phase that reduces the
number of redundant AST forms.
Passes toolstash -cmp.
Change-Id: I20df91bbd0d885c1f18ec67feb61ae1558670719
Reviewed-on: https://go-review.googlesource.com/c/go/+/280636
Trust: Matthew Dempsky <mdempsky@google.com>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
|
|
After earlier importer refactorings, most of the importer is now
reentrant, so we don't need to guard against it at Resolve. The only
remaining part that is still not reentrant is inline body importing,
so move the recursive-import check there.
Passes toolstash -cmp.
Change-Id: Ia828f880a03e6125b102668c12a155d4c253d26b
Reviewed-on: https://go-review.googlesource.com/c/go/+/280515
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
|
|
Select and switch statements only ever contain case statements, so
change their Cases fields from Nodes to []*CaseStmt. This allows
removing a bunch of type assertions throughout the compiler.
CaseStmt should be renamed to CaseClause, and SelectStmt should
probably have its own CommClause type instead (like in go/ast and
cmd/compile/internal/syntax), but this is a good start.
Passes toolstash -cmp.
Change-Id: I2d41d616d44512c2be421e1e2ff13d0ee8b238ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/280442
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
|
|
ODOTMETH is unique among SelectorExpr expressions, in that Sel gets
mangled so that it no longer has the original identifier that was
selected (e.g., just "Foo"), but instead the qualified symbol name for
the selected method (e.g., "pkg.Type.Foo"). This is rarely useful, and
instead results in a lot of compiler code needing to worry about
undoing this change.
This CL changes ODOTMETH to leave the original symbol in place. The
handful of code locations where the mangled symbol name is actually
wanted are updated to use ir.MethodExprName(n).Sym() or (equivalently)
ir.MethodExprName(n).Func.Sym() instead.
Historically, the compiler backend has mistakenly used types.Syms
where it should have used ir.Name/ir.Funcs. And this change in
particular may risk breaking something, as the SelectorExpr.Sel will
no longer point at a symbol that uniquely identifies the called
method. However, I expect CL 280294 (desugar OCALLMETH into OCALLFUNC)
to have substantially reduced this risk, as ODOTMETH expressions are
now replaced entirely earlier in the compiler.
Passes toolstash -cmp.
Change-Id: If3c9c3b7df78ea969f135840574cf89e1d263876
Reviewed-on: https://go-review.googlesource.com/c/go/+/280436
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
|
|
Now that the previous CL ensures we always set SelectorExpr.Selection,
we can replace the SelectorExpr.Offset field with a helper method that
simply returns SelectorExpr.Selection.Offset.
Passes toolstash -cmp.
Change-Id: Id0f22b8b1980397b668f6860d27cb197b90ff52a
Reviewed-on: https://go-review.googlesource.com/c/go/+/280433
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
|
|
The assignment type-checking code previously bounced around a lot
between the LHS and RHS sides of the assignment. But there's actually
a very simple, consistent pattern to how to type check assignments:
1. Check the RHS expression.
2. If the LHS expression is an identifier that was declared in this
statement and it doesn't have an explicit type, give it the RHS
expression's default type.
3. Check the LHS expression.
4. Try assigning the RHS expression to the LHS expression, adding
implicit conversions as needed.
This CL implements this algorithm, and refactors tcAssign and
tcAssignList to use a common implementation. It also fixes the error
messages to consistently say just "1 variable" or "1 value", rather
than occasionally "1 variables" or "1 values".
Fixes #43348.
Passes toolstash -cmp.
Change-Id: I749cb8d6ccbc7d22cd7cb0a381f58a39fc2696b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/280112
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
|
|
ir.IsAssignable does not include map index expression, so it should be
named ir.IsAddressable instead.
[git-generate]
cd src/cmd/compile/internal/ir
rf '
mv IsAssignable IsAddressable
'
Change-Id: Ief6188e7b784ba9592d7b0cbec33b5f70d78f638
Reviewed-on: https://go-review.googlesource.com/c/go/+/279436
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
|
|
typecheck1 is the largest non-machine-generated function in the compiler.
weighing in at 1,747 lines. Since we are destroying the git blame history
anyway, now is a good time to split each different case into its own function,
making future work on this function more manageable.
[git-generate]
cd src/cmd/compile/internal/typecheck
rf '
# Remove tracing print from typecheck1 - the one in typecheck is fine.
# Removing it lets us remove the named result.
# That lets all the cut-out functions not have named results.
rm typecheck.go:/^func typecheck1/+0,/^func typecheck1/+4
sub typecheck.go:/^func typecheck1/+/\(res ir\.Node\)/ ir.Node
mv typecheckselect tcSelect
mv typecheckswitch tcSwitch
mv typecheckrange tcRange
mv typecheckfunc tcFunc
mv checkdefergo tcGoDefer
mv typecheckclosure tcClosure
mv check typecheck
mv typecheckcomplit tcCompLit
mv typecheckas tcAssign
mv typecheckas2 tcAssignList
mv typecheckpartialcall tcCallPart
mv typecheckExprSwitch tcSwitchExpr
mv typecheckTypeSwitch tcSwitchType
mv typecheck1:/^\tcase ir.ORETURN:/+2,/^\tcase /-2 tcReturn
add typecheck.go:/^func tcReturn/-0 \
// tcReturn typechecks an ORETURN node.
mv typecheck1:/^\tcase ir.OIF:/+2,/^\tcase /-2 tcIf
add typecheck.go:/^func tcIf/-0 \
// tcIf typechecks an OIF node.
mv typecheck1:/^\tcase ir.OFOR,/+2,/^\tcase /-2 tcFor
add typecheck.go:/^func tcFor/-0 \
// tcFor typechecks an OFOR node.
mv typecheck1:/^\tcase ir.OSPTR:/+2,/^\tcase /-2 tcSPtr
add typecheck.go:/^func tcSPtr/-0 \
// tcSPtr typechecks an OSPTR node.
mv typecheck1:/^\tcase ir.OITAB:/+2,/^\tcase /-2 tcITab
add typecheck.go:/^func tcITab/-0 \
// tcITab typechecks an OITAB node.
mv typecheck1:/^\tcase ir.ORECOVER:/+2,/^\tcase /-2 tcRecover
add typecheck.go:/^func tcRecover/-0 \
// tcRecover typechecks an ORECOVER node.
mv typecheck1:/^\tcase ir.OPANIC:/+2,/^\tcase /-2 tcPanic
add typecheck.go:/^func tcPanic/-0 \
// tcPanic typechecks an OPANIC node.
mv typecheck1:/^\tcase ir.OPRINT,/+2,/^\tcase /-2 tcPrint
add typecheck.go:/^func tcPrint/-0 \
// tcPrint typechecks an OPRINT or OPRINTN node.
mv typecheck1:/^\tcase ir.ONEW:/+2,/^\tcase /-2 tcNew
add typecheck.go:/^func tcNew/-0 \
// tcNew typechecks an ONEW node.
mv typecheck1:/^\tcase ir.OMAKE:/+2,/^\tcase /-2 tcMake
add typecheck.go:/^func tcMake/-0 \
// tcMake typechecks an OMAKE node.
mv typecheck1:/^\tcase ir.OCONV:/+2,/^\tcase /-2 tcConv
add typecheck.go:/^func tcConv/-0 \
// tcConv typechecks an OCONV node.
mv typecheck1:/^\tcase ir.OCOPY:/+2,/^\tcase /-2 tcCopy
add typecheck.go:/^func tcCopy/-0 \
// tcCopy typechecks an OCOPY node.
mv typecheck1:/^\tcase ir.OAPPEND:/+2,/^\tcase /-2 tcAppend
add typecheck.go:/^func tcAppend/-0 \
// tcAppend typechecks an OAPPEND node.
mv typecheck1:/^\tcase ir.ODELETE:/+2,/^\tcase /-2 tcDelete
add typecheck.go:/^func tcDelete/-0 \
// tcDelete typechecks an ODELETE node.
mv typecheck1:/^\tcase ir.OCLOSE:/+2,/^\tcase /-2 tcClose
add typecheck.go:/^func tcClose/-0 \
// tcClose typechecks an OCLOSE node.
mv typecheck1:/^\tcase ir.OCOMPLEX:/+2,/^\tcase /-2 tcComplex
add typecheck.go:/^func tcComplex/-0 \
// tcComplex typechecks an OCOMPLEX node.
mv typecheck1:/^\tcase ir.OREAL,/+2,/^\tcase /-2 tcRealImag
add typecheck.go:/^func tcRealImag/-0 \
// tcRealImag typechecks an OREAL or OIMAG node.
mv typecheck1:/^\tcase ir.OCAP,/+2,/^\tcase /-2 tcLenCap
add typecheck.go:/^func tcLenCap/-0 \
// tcLenCap typechecks an OLEN or OCAP node.
mv typecheck1:/^\tcase ir.OCALL:/+2,/^\tcase /-2 tcCall
add typecheck.go:/^func tcCall/-0 \
// tcCall typechecks an OCALL node.
mv typecheck1:/^\tcase ir.OSLICE,/+2,/^\tcase /-3 tcSlice
add typecheck.go:/^func tcSlice/-0 \
// tcSlice typechecks an OSLICE or OSLICE3 node.
# move type assertion above comment
mv typecheck1:/^\tcase ir.OMAKESLICECOPY:/+/n := n/-+ typecheck1:/^\tcase ir.OMAKESLICECOPY:/+0
mv typecheck1:/^\tcase ir.OMAKESLICECOPY:/+2,/^\tcase /-2 tcMakeSliceCopy
add typecheck.go:/^func tcMakeSliceCopy/-0 \
// tcMakeSliceCopy typechecks an OMAKESLICECOPY node.
# move type assertion above comment
mv typecheck1:/^\tcase ir.OSLICEHEADER:/+/n := n/-+ typecheck1:/^\tcase ir.OSLICEHEADER:/+0
mv typecheck1:/^\tcase ir.OSLICEHEADER:/+2,/^\tcase /-2 tcSliceHeader
add typecheck.go:/^func tcSliceHeader/-0 \
// tcSliceHeader typechecks an OSLICEHEADER node.
mv typecheck1:/^\tcase ir.OSEND:/+2,/^\tcase /-2 tcSend
add typecheck.go:/^func tcSend/-0 \
// tcSend typechecks an OSEND node.
mv typecheck1:/^\tcase ir.ORECV:/+2,/^\tcase /-2 tcRecv
add typecheck.go:/^func tcRecv/-0 \
// tcRecv typechecks an ORECV node.
mv typecheck1:/^\tcase ir.OINDEX:/+2,/^\tcase /-2 tcIndex
add typecheck.go:/^func tcIndex/-0 \
// tcIndex typechecks an OINDEX node.
mv typecheck1:/^\tcase ir.ODOTTYPE:/+2,/^\tcase /-2 tcDotType
add typecheck.go:/^func tcDotType/-0 \
// tcDotType typechecks an ODOTTYPE node.
mv typecheck1:/^\tcase ir.OXDOT,/+2,/^\tcase /-2 tcDot
add typecheck.go:/^func tcDot/-0 \
// tcDot typechecks an OXDOT or ODOT node.
mv typecheck1:/^\tcase ir.OADDR:/+2,/^\tcase /-2 tcAddr
add typecheck.go:/^func tcAddr/-0 \
// tcAddr typechecks an OADDR node.
mv typecheck1:/^\tcase ir.OBITNOT,/+2,/^\tcase /-3 tcUnaryArith
add typecheck.go:/^func tcUnaryArith/-0 \
// tcUnaryArith typechecks a unary arithmetic expression.
mv typecheck1:/^\t\tir.OXOR:/+1,/^\tcase /-2 tcArith
add typecheck.go:/^func tcArith/-0 \
// tcArith typechecks a binary arithmetic expression.
mv typecheck1:/^\tcase ir.ODEREF:/+2,/^\tcase /-2 tcStar
add typecheck.go:/^func tcStar/-0 \
// tcStar typechecks an ODEREF node, which may be an expression or a type.
mv typecheck1:/^\tcase ir.OTFUNC:/+2,/^\tcase /-2 tcFuncType
add typecheck.go:/^func tcFuncType/-0 \
// tcFuncType typechecks an OTFUNC node.
mv typecheck1:/^\tcase ir.OTINTER:/+2,/^\tcase /-2 tcInterfaceType
add typecheck.go:/^func tcInterfaceType/-0 \
// tcInterfaceType typechecks an OTINTER node.
mv typecheck1:/^\tcase ir.OTSTRUCT:/+2,/^\tcase /-2 tcStructType
add typecheck.go:/^func tcStructType/-0 \
// tcStructType typechecks an OTSTRUCT node.
mv typecheck1:/^\tcase ir.OTCHAN:/+2,/^\tcase /-2 tcChanType
add typecheck.go:/^func tcChanType/-0 \
// tcChanType typechecks an OTCHAN node.
mv typecheck1:/^\tcase ir.OTMAP:/+2,/^\tcase /-2 tcMapType
add typecheck.go:/^func tcMapType/-0 \
// tcMapType typechecks an OTMAP node.
mv typecheck1:/^\tcase ir.OTARRAY:/+2,/^\tcase /-2 tcArrayType
add typecheck.go:/^func tcArrayType/-0 \
// tcArrayType typechecks an OTARRAY node.
mv typecheck1:/^\tcase ir.OTSLICE:/+2,/^\tcase /-2 tcSliceType
add typecheck.go:/^func tcSliceType/-0 \
// tcSliceType typechecks an OTSLICE node.
mv \
tcAssign \
tcAssignList \
tcFor \
tcGoDefer \
tcIf \
tcRange \
tcReturn \
tcSelect \
tcSend \
tcSwitch \
tcSwitchExpr \
tcSwitchType \
typeSet \
typeSetEntry \
typeSet.add \
stmt1.go
mv stmt1.go stmt.go
mv \
tcAddr \
tcArith \
tcArrayType \
tcChanType \
tcClosure \
tcCompLit \
tcConv \
tcDot \
tcDotType \
tcFuncType \
tcITab \
tcIndex \
tcInterfaceType \
tcLenCap \
tcMapType \
tcRecv \
tcSPtr \
tcSlice \
tcSliceHeader \
tcSliceType \
tcStar \
tcStructType \
tcUnaryArith \
expr.go
mv \
tcClosure \
tcCallPart \
tcFunc \
tcCall \
tcAppend \
tcClose \
tcComplex \
tcCopy \
tcDelete \
tcMake \
tcMakeSliceCopy \
tcNew \
tcPanic \
tcPrint \
tcRealImag \
tcRecover \
func1.go
mv func1.go func.go
mv \
tcArrayType \
tcChanType \
tcFuncType \
tcInterfaceType \
tcMapType \
tcSliceType \
tcStructType \
type.go
'
Change-Id: I0fb0a3039005bc1783575291daff1e6c306895ff
Reviewed-on: https://go-review.googlesource.com/c/go/+/279429
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
|
|
This commit splits the typechecking logic into its own package,
the first of a sequence of CLs to break package gc into more
manageable units.
[git-generate]
cd src/cmd/compile/internal/gc
rf '
# The binary import/export has to be part of typechecking,
# because we load inlined function bodies lazily, but "exporter"
# should not be. Move that out of bexport.go.
mv exporter exporter.markObject exporter.markType export.go
# Use the typechecking helpers, so that the calls left behind
# in package gc do not need access to ctxExpr etc.
ex {
import "cmd/compile/internal/ir"
# TODO(rsc): Should not be necessary.
avoid TypecheckExpr
avoid TypecheckStmt
avoid TypecheckExprs
avoid TypecheckStmts
avoid TypecheckAssignExpr
avoid TypecheckCallee
var n ir.Node
var ns []ir.Node
typecheck(n, ctxExpr) -> TypecheckExpr(n)
typecheck(n, ctxStmt) -> TypecheckStmt(n)
typecheckslice(ns, ctxExpr) -> TypecheckExprs(ns)
typecheckslice(ns, ctxStmt) -> TypecheckStmts(ns)
typecheck(n, ctxExpr|ctxAssign) -> TypecheckAssignExpr(n)
typecheck(n, ctxExpr|ctxCallee) -> TypecheckCallee(n)
}
# Move some typechecking API to typecheck.
mv syslook LookupRuntime
mv substArgTypes SubstArgTypes
mv LookupRuntime SubstArgTypes syms.go
mv conv Conv
mv convnop ConvNop
mv Conv ConvNop typecheck.go
mv colasdefn AssignDefn
mv colasname assignableName
mv Target target.go
mv initname autoexport exportsym dcl.go
mv exportsym Export
# Export API to be called from outside typecheck.
# The ones with "Typecheck" prefixes will be renamed later to drop the prefix.
mv adddot AddImplicitDots
mv assignconv AssignConv
mv expandmeth CalcMethods
mv capturevarscomplete CaptureVarsComplete
mv checkMapKeys CheckMapKeys
mv checkreturn CheckReturn
mv dclcontext DeclContext
mv dclfunc DeclFunc
mv declare Declare
mv dotImportRefs DotImportRefs
mv declImporter DeclImporter
mv variter DeclVars
mv defaultlit DefaultLit
mv evalConst EvalConst
mv expandInline ImportBody
mv finishUniverse declareUniverse
mv funcbody FinishFuncBody
mv funchdr StartFuncBody
mv indexconst IndexConst
mv initTodo InitTodoFunc
mv lookup Lookup
mv resolve Resolve
mv lookupN LookupNum
mv nodAddr NodAddr
mv nodAddrAt NodAddrAt
mv nodnil NodNil
mv origBoolConst OrigBool
mv origConst OrigConst
mv origIntConst OrigInt
mv redeclare Redeclared
mv tostruct NewStructType
mv functype NewFuncType
mv methodfunc NewMethodType
mv structargs NewFuncParams
mv temp Temp
mv tempAt TempAt
mv typecheckok TypecheckAllowed
mv typecheck _typecheck # make room for typecheck pkg
mv typecheckinl TypecheckImportedBody
mv typecheckFunc TypecheckFunc
mv iimport ReadImports
mv iexport WriteExports
mv sysfunc LookupRuntimeFunc
mv sysvar LookupRuntimeVar
# Move function constructors to typecheck.
mv mkdotargslice MakeDotArgs
mv fixVariadicCall FixVariadicCall
mv closureType ClosureType
mv partialCallType PartialCallType
mv capturevars CaptureVars
mv MakeDotArgs FixVariadicCall ClosureType PartialCallType CaptureVars typecheckclosure func.go
mv autolabel AutoLabel
mv AutoLabel syms.go
mv Dlist dlist
mv Symlink symlink
mv \
AssignDefn assignableName \
AssignConv \
CaptureVarsComplete \
DeclContext \
DeclFunc \
DeclImporter \
DeclVars \
Declare \
DotImportRefs \
Export \
InitTodoFunc \
Lookup \
LookupNum \
LookupRuntimeFunc \
LookupRuntimeVar \
NewFuncParams \
NewName \
NodAddr \
NodAddrAt \
NodNil \
Redeclared \
StartFuncBody \
FinishFuncBody \
TypecheckImportedBody \
AddImplicitDots \
CalcMethods \
CheckFuncStack \
NewFuncType \
NewMethodType \
NewStructType \
TypecheckAllowed \
Temp \
TempAt \
adddot1 \
dotlist \
addmethod \
assignconvfn \
assignop \
autotmpname \
autoexport \
bexport.go \
checkdupfields \
checkembeddedtype \
closurename \
convertop \
declare_typegen \
decldepth \
dlist \
dotpath \
expand0 \
expand1 \
expandDecl \
fakeRecvField \
fnpkg \
funcStack \
funcStackEnt \
funcarg \
funcarg2 \
funcargs \
funcargs2 \
globClosgen \
ifacelookdot \
implements \
importalias \
importconst \
importfunc \
importobj \
importsym \
importtype \
importvar \
inimport \
initname \
isptrto \
loadsys \
lookdot0 \
lookdot1 \
makepartialcall \
okfor \
okforlen \
operandType \
slist \
symlink \
tointerface \
typeSet \
typeSet.add \
typeSetEntry \
typecheckExprSwitch \
typecheckTypeSwitch \
typecheckpartialcall \
typecheckrange \
typecheckrangeExpr \
typecheckselect \
typecheckswitch \
vargen \
builtin.go \
builtin_test.go \
const.go \
func.go \
iexport.go \
iimport.go \
mapfile_mmap.go \
syms.go \
target.go \
typecheck.go \
unsafe.go \
universe.go \
cmd/compile/internal/typecheck
'
rm gen.go types.go types_acc.go
sed -i '' 's/package gc/package typecheck/' mapfile_read.go mkbuiltin.go
mv mapfile_read.go ../typecheck # not part of default build
mv mkbuiltin.go ../typecheck # package main helper
mv builtin ../typecheck
cd ../typecheck
mv dcl.go dcl1.go
mv typecheck.go typecheck1.go
mv universe.go universe1.go
rf '
# Sweep some small files into larger ones.
# "mv sym... file1.go file.go" (after the mv file1.go file.go above)
# lets us insert sym... at the top of file.go.
mv okfor okforeq universe1.go universe.go
mv DeclContext vargen dcl1.go Temp TempAt autotmpname NewMethodType dcl.go
mv InitTodoFunc inimport decldepth TypecheckAllowed typecheck1.go typecheck.go
mv inl.go closure.go func.go
mv range.go select.go swt.go stmt.go
mv Lookup loadsys LookupRuntimeFunc LookupRuntimeVar syms.go
mv unsafe.go const.go
mv TypecheckAssignExpr AssignExpr
mv TypecheckExpr Expr
mv TypecheckStmt Stmt
mv TypecheckExprs Exprs
mv TypecheckStmts Stmts
mv TypecheckCall Call
mv TypecheckCallee Callee
mv _typecheck check
mv TypecheckFunc Func
mv TypecheckFuncBody FuncBody
mv TypecheckImports AllImportedBodies
mv TypecheckImportedBody ImportedBody
mv TypecheckInit Init
mv TypecheckPackage Package
'
rm gen.go go.go init.go main.go reflect.go
Change-Id: Iea6a7aaf6407d690670ec58aeb36cc0b280f80b0
Reviewed-on: https://go-review.googlesource.com/c/go/+/279236
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
|