277 // are required, from _cnt to _max-1 are precedence edges. 278 node_idx_t _cnt; // Total number of required Node inputs. 279 280 node_idx_t _max; // Actual length of input array. 281 282 // Output edges are an unordered list of def-use edges which exactly 283 // correspond to required input edges which point from other nodes 284 // to this one. Thus the count of the output edges is the number of 285 // users of this node. 286 node_idx_t _outcnt; // Total number of Node outputs. 287 288 node_idx_t _outmax; // Actual length of output array. 289 290 // Grow the actual input array to the next larger power-of-2 bigger than len. 291 void grow( uint len ); 292 // Grow the output array to the next larger power-of-2 bigger than len. 293 void out_grow( uint len ); 294 295 public: 296 // Each Node is assigned a unique small/dense number. This number is used 297 // to index into auxiliary arrays of data and bitvectors. 298 // It is declared const to defend against inadvertant assignment, 299 // since it is used by clients as a naked field. 300 const node_idx_t _idx; 301 302 // Get the (read-only) number of input edges 303 uint req() const { return _cnt; } 304 uint len() const { return _max; } 305 // Get the (read-only) number of output edges 306 uint outcnt() const { return _outcnt; } 307 308 #if OPTO_DU_ITERATOR_ASSERT 309 // Iterate over the out-edges of this node. Deletions are illegal. 310 inline DUIterator outs() const; 311 // Use this when the out array might have changed to suppress asserts. 312 inline DUIterator& refresh_out_pos(DUIterator& i) const; 313 // Does the node have an out at this position? (Used for iteration.) 314 inline bool has_out(DUIterator& i) const; 315 inline Node* out(DUIterator& i) const; 316 // Iterate over the out-edges of this node. All changes are illegal. 317 inline DUIterator_Fast fast_outs(DUIterator_Fast& max) const; 318 inline Node* fast_out(DUIterator_Fast& i) const; 319 // Iterate over the out-edges of this node, deleting one at a time. 320 inline DUIterator_Last last_outs(DUIterator_Last& min) const; | 277 // are required, from _cnt to _max-1 are precedence edges. 278 node_idx_t _cnt; // Total number of required Node inputs. 279 280 node_idx_t _max; // Actual length of input array. 281 282 // Output edges are an unordered list of def-use edges which exactly 283 // correspond to required input edges which point from other nodes 284 // to this one. Thus the count of the output edges is the number of 285 // users of this node. 286 node_idx_t _outcnt; // Total number of Node outputs. 287 288 node_idx_t _outmax; // Actual length of output array. 289 290 // Grow the actual input array to the next larger power-of-2 bigger than len. 291 void grow( uint len ); 292 // Grow the output array to the next larger power-of-2 bigger than len. 293 void out_grow( uint len ); 294 295 public: 296 // Each Node is assigned a unique small/dense number. This number is used 297 // to index into auxiliary arrays of data and bit vectors. 298 // The field _idx is declared constant to defend against inadvertent assignments, 299 // since it is used by clients as a naked field. However, the field's value can be 300 // changed using the set_idx() method. 301 // 302 // The PhaseRenumberLive phase renumbers nodes based on liveness information. 303 // Therefore, it updates the value of the _idx field. The parse-time _idx is 304 // preserved in _parse_idx. 305 const node_idx_t _idx; 306 DEBUG_ONLY(const node_idx_t _parse_idx;) 307 308 // Get the (read-only) number of input edges 309 uint req() const { return _cnt; } 310 uint len() const { return _max; } 311 // Get the (read-only) number of output edges 312 uint outcnt() const { return _outcnt; } 313 314 #if OPTO_DU_ITERATOR_ASSERT 315 // Iterate over the out-edges of this node. Deletions are illegal. 316 inline DUIterator outs() const; 317 // Use this when the out array might have changed to suppress asserts. 318 inline DUIterator& refresh_out_pos(DUIterator& i) const; 319 // Does the node have an out at this position? (Used for iteration.) 320 inline bool has_out(DUIterator& i) const; 321 inline Node* out(DUIterator& i) const; 322 // Iterate over the out-edges of this node. All changes are illegal. 323 inline DUIterator_Fast fast_outs(DUIterator_Fast& max) const; 324 inline Node* fast_out(DUIterator_Fast& i) const; 325 // Iterate over the out-edges of this node, deleting one at a time. 326 inline DUIterator_Last last_outs(DUIterator_Last& min) const; |