"[]byte %x": "",
"[]cmd/compile/internal/ssa.Edge %v": "",
"[]cmd/compile/internal/ssa.ID %v": "",
+ "[]cmd/compile/internal/ssa.posetNode %v": "",
+ "[]cmd/compile/internal/ssa.posetUndo %v": "",
"[]cmd/compile/internal/syntax.token %s": "",
"[]string %v": "",
"[]uint32 %v": "",
"uint16 %v": "",
"uint16 %x": "",
"uint32 %d": "",
+ "uint32 %v": "",
"uint32 %x": "",
"uint64 %08x": "",
"uint64 %d": "",
// It can be used for debugging purposes, as a poset is supposed to
// be empty after it's fully rolled back through Undo.
func (po *poset) CheckEmpty() error {
- // Check that the poset is completely empty
+ if len(po.nodes) != 1 {
+ return fmt.Errorf("non-empty nodes list: %v", po.nodes)
+ }
if len(po.values) != 0 {
return fmt.Errorf("non-empty value map: %v", po.values)
}
if len(po.roots) != 0 {
return fmt.Errorf("non-empty root list: %v", po.roots)
}
+ if len(po.constants) != 0 {
+ return fmt.Errorf("non-empty constants: %v", po.constants)
+ }
+ if len(po.undo) != 0 {
+ return fmt.Errorf("non-empty undo list: %v", po.undo)
+ }
+ if po.lastidx != 0 {
+ return fmt.Errorf("lastidx index is not zero: %v", po.lastidx)
+ }
for _, bs := range po.noneq {
for _, x := range bs {
if x != 0 {
}
}
}
- for idx, n := range po.nodes {
- if n.l|n.r != 0 {
- return fmt.Errorf("non-empty node %v->[%d,%d]", idx, n.l.Target(), n.r.Target())
- }
- }
- if len(po.constants) != 0 {
- return fmt.Errorf("non-empty constant")
- }
return nil
}
po.noneq[pass.ID].Clear(pass.idx)
case undoNewNode:
+ if pass.idx != po.lastidx {
+ panic("invalid newnode index")
+ }
if pass.ID != 0 {
if po.values[pass.ID] != pass.idx {
panic("invalid newnode undo pass")
}
po.setchl(pass.idx, 0)
po.setchr(pass.idx, 0)
+ po.nodes = po.nodes[:pass.idx]
+ po.lastidx--
// If it was the last inserted constant, remove it
nc := len(po.constants)