• Russ Cox's avatar
    cmd/gc: distinguish unnamed vs blank-named return variables better · a069cf04
    Russ Cox authored
    Before, an unnamed return value turned into an ONAME node n with n->sym
    named ~anon%d, and n->orig == n.
    
    A blank-named return value turned into an ONAME node n with n->sym
    named ~anon%d but n->orig == the original blank n. Code generation and
    printing uses n->orig, so that this node formatted as _.
    
    But some code does not use n->orig. In particular the liveness code does
    not know about the n->orig convention and so mishandles blank identifiers.
    It is possible to fix but seemed better to avoid the confusion entirely.
    
    Now the first kind of node is named ~r%d and the second ~b%d; both have
    n->orig == n, so that it doesn't matter whether code uses n or n->orig.
    
    After this change the ->orig field is only used for other kinds of expressions,
    not for ONAME nodes.
    
    This requires distinguishing ~b from ~r names in a few places that care.
    It fixes a liveness analysis bug without actually changing the liveness code.
    
    TBR=ken2
    CC=golang-codereviews
    https://golang.org/cl/63630043
    a069cf04
Name
Last commit
Last update
..
5a Loading commit data...
5c Loading commit data...
5g Loading commit data...
5l Loading commit data...
6a Loading commit data...
6c Loading commit data...
6g Loading commit data...
6l Loading commit data...
8a Loading commit data...
8c Loading commit data...
8g Loading commit data...
8l Loading commit data...
addr2line Loading commit data...
api Loading commit data...
cc Loading commit data...
cgo Loading commit data...
dist Loading commit data...
fix Loading commit data...
gc Loading commit data...
go Loading commit data...
gofmt Loading commit data...
ld Loading commit data...
link Loading commit data...
nm Loading commit data...
objdump Loading commit data...
pack Loading commit data...
prof Loading commit data...
yacc Loading commit data...