• Robert Griesemer's avatar
    cmd/compile/internal/gc: add tracing support to debug type checking · e25823ed
    Robert Griesemer authored
    The compiler must first be built with the constant enableTrace set
    to true (typecheck.go). After that, the -t flag becomes available
    which enables tracing output of type-checking functions.
    
    With enableTrace == false, the tracing code becomes dead code
    and won't affect the compiler.
    
    Typical output might look like this:
    
    path/y.go:4:6: typecheck 0xc00033e180 DCLTYPE <node DCLTYPE> tc=0
    path/y.go:4:6: . typecheck1 0xc00033e180 DCLTYPE <node DCLTYPE> tc=2
    path/y.go:4:6: . . typecheck 0xc000331a40 TYPE T tc=1
    path/y.go:4:6: . . . typecheck1 0xc000331a40 TYPE T tc=2
    path/y.go:4:6: . . . . typecheckdef 0xc000331a40 TYPE T tc=2
    path/y.go:4:6: . . . . => 0xc000331a40 TYPE T tc=2 type=*T
    path/y.go:4:6: . . . => 0xc000331a40 TYPE T tc=2 type=*T
    path/y.go:4:6: . . => 0xc000331a40 TYPE T tc=1 type=*T
    path/y.go:4:6: . => 0xc00033e180 DCLTYPE <node DCLTYPE> tc=2 type=<T>
    path/y.go:4:6: => 0xc00033e180 DCLTYPE <node DCLTYPE> tc=1 type=<T>
    
    Disabled by default.
    
    Change-Id: Ifd8385290d1cf0d3fc5e8468b2f4ab84e8eff338
    Reviewed-on: https://go-review.googlesource.com/c/146782Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
    e25823ed
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...