LEFT | RIGHT |
1 package ssa | 1 package ssa |
2 | 2 |
3 // This package defines a high-level intermediate representation for | 3 // This package defines a high-level intermediate representation for |
4 // Go programs using static single-assignment (SSA) form. | 4 // Go programs using static single-assignment (SSA) form. |
5 | 5 |
6 import ( | 6 import ( |
7 "fmt" | 7 "fmt" |
8 "go/ast" | 8 "go/ast" |
9 "go/token" | 9 "go/token" |
10 "go/types" | 10 "go/types" |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 // The order of Preds and Succs are significant (to Phi and If | 260 // The order of Preds and Succs are significant (to Phi and If |
261 // instructions, respectively). | 261 // instructions, respectively). |
262 // | 262 // |
263 type BasicBlock struct { | 263 type BasicBlock struct { |
264 Index int // index of this block within Func.Blocks | 264 Index int // index of this block within Func.Blocks |
265 Comment string // optional label; no semantic significance | 265 Comment string // optional label; no semantic significance |
266 Func *Function // containing function | 266 Func *Function // containing function |
267 Instrs []Instruction // instructions in order | 267 Instrs []Instruction // instructions in order |
268 Preds, Succs []*BasicBlock // predecessors and successors | 268 Preds, Succs []*BasicBlock // predecessors and successors |
269 succs2 [2]*BasicBlock // initial space for Succs. | 269 succs2 [2]*BasicBlock // initial space for Succs. |
270 » dom *domTree // node in dominator tree; optional. | 270 » dom *domNode // node in dominator tree; optional. |
271 gaps int // number of nil Instrs (transient). | 271 gaps int // number of nil Instrs (transient). |
272 } | 272 } |
273 | 273 |
274 // Pure values ---------------------------------------- | 274 // Pure values ---------------------------------------- |
275 | 275 |
276 // A Capture is a pointer to a lexically enclosing local variable. | 276 // A Capture is a pointer to a lexically enclosing local variable. |
277 // | 277 // |
278 // The referent of a capture is an Alloc or another Capture and is | 278 // The referent of a capture is an Alloc or another Capture and is |
279 // always considered potentially escaping, so Captures are always | 279 // always considered potentially escaping, so Captures are always |
280 // addresses in the heap, and have pointer types. | 280 // addresses in the heap, and have pointer types. |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 return append(rands, &s.Addr, &s.Val) | 1264 return append(rands, &s.Addr, &s.Val) |
1265 } | 1265 } |
1266 | 1266 |
1267 func (v *TypeAssert) Operands(rands []*Value) []*Value { | 1267 func (v *TypeAssert) Operands(rands []*Value) []*Value { |
1268 return append(rands, &v.X) | 1268 return append(rands, &v.X) |
1269 } | 1269 } |
1270 | 1270 |
1271 func (v *UnOp) Operands(rands []*Value) []*Value { | 1271 func (v *UnOp) Operands(rands []*Value) []*Value { |
1272 return append(rands, &v.X) | 1272 return append(rands, &v.X) |
1273 } | 1273 } |
LEFT | RIGHT |