1 //===-- llvm/CodeGen/MachineBasicBlock.h ------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Collect the sequence of machine instructions for a basic block.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CODEGEN_MACHINEBASICBLOCK_H
15 #define LLVM_CODEGEN_MACHINEBASICBLOCK_H
17 #include "llvm/CodeGen/MachineInstr.h"
18 #include "llvm/ADT/GraphTraits.h"
19 #include "llvm/Support/DataTypes.h"
26 class MachineFunction;
31 class MachineBranchProbabilityInfo;
34 struct ilist_traits<MachineInstr> : public ilist_default_traits<MachineInstr> {
36 mutable ilist_half_node<MachineInstr> Sentinel;
38 // this is only set by the MachineBasicBlock owning the LiveList
39 friend class MachineBasicBlock;
40 MachineBasicBlock* Parent;
43 MachineInstr *createSentinel() const {
44 return static_cast<MachineInstr*>(&Sentinel);
46 void destroySentinel(MachineInstr *) const {}
48 MachineInstr *provideInitialHead() const { return createSentinel(); }
49 MachineInstr *ensureHead(MachineInstr*) const { return createSentinel(); }
50 static void noteHead(MachineInstr*, MachineInstr*) {}
52 void addNodeToList(MachineInstr* N);
53 void removeNodeFromList(MachineInstr* N);
54 void transferNodesFromList(ilist_traits &SrcTraits,
55 ilist_iterator<MachineInstr> first,
56 ilist_iterator<MachineInstr> last);
57 void deleteNode(MachineInstr *N);
59 void createNode(const MachineInstr &);
62 class MachineBasicBlock : public ilist_node<MachineBasicBlock> {
63 typedef ilist<MachineInstr> Instructions;
67 MachineFunction *xParent;
69 /// Predecessors/Successors - Keep track of the predecessor / successor
71 std::vector<MachineBasicBlock *> Predecessors;
72 std::vector<MachineBasicBlock *> Successors;
75 /// Weights - Keep track of the weights to the successors. This vector
76 /// has the same order as Successors, or it is empty if we don't use it
77 /// (disable optimization).
78 std::vector<uint32_t> Weights;
79 typedef std::vector<uint32_t>::iterator weight_iterator;
81 /// LiveIns - Keep track of the physical registers that are livein of
83 std::vector<unsigned> LiveIns;
85 /// Alignment - Alignment of the basic block. Zero if the basic block does
86 /// not need to be aligned.
87 /// The alignment is specified as log2(bytes).
90 /// IsLandingPad - Indicate that this basic block is entered via an
91 /// exception handler.
94 /// AddressTaken - Indicate that this basic block is potentially the
95 /// target of an indirect branch.
98 // Intrusive list support
99 MachineBasicBlock() {}
101 explicit MachineBasicBlock(MachineFunction &mf, const BasicBlock *bb);
103 ~MachineBasicBlock();
105 // MachineBasicBlocks are allocated and owned by MachineFunction.
106 friend class MachineFunction;
109 /// getBasicBlock - Return the LLVM basic block that this instance
110 /// corresponded to originally. Note that this may be NULL if this instance
111 /// does not correspond directly to an LLVM basic block.
113 const BasicBlock *getBasicBlock() const { return BB; }
115 /// getName - Return the name of the corresponding LLVM basic block, or
117 StringRef getName() const;
119 /// hasAddressTaken - Test whether this block is potentially the target
120 /// of an indirect branch.
121 bool hasAddressTaken() const { return AddressTaken; }
123 /// setHasAddressTaken - Set this block to reflect that it potentially
124 /// is the target of an indirect branch.
125 void setHasAddressTaken() { AddressTaken = true; }
127 /// getParent - Return the MachineFunction containing this basic block.
129 const MachineFunction *getParent() const { return xParent; }
130 MachineFunction *getParent() { return xParent; }
133 /// bundle_iterator - MachineBasicBlock iterator that automatically skips over
134 /// MIs that are inside bundles (i.e. walk top level MIs only).
135 template<typename Ty, typename IterTy>
136 class bundle_iterator
137 : public std::iterator<std::bidirectional_iterator_tag, Ty, ptrdiff_t> {
141 bundle_iterator(IterTy mii) : MII(mii) {
142 assert(!MII->isInsideBundle() &&
143 "It's not legal to initialize bundle_iterator with a bundled MI");
146 bundle_iterator(Ty &mi) : MII(mi) {
147 assert(!mi.isInsideBundle() &&
148 "It's not legal to initialize bundle_iterator with a bundled MI");
150 bundle_iterator(Ty *mi) : MII(mi) {
151 assert((!mi || !mi->isInsideBundle()) &&
152 "It's not legal to initialize bundle_iterator with a bundled MI");
154 bundle_iterator(const bundle_iterator &I) : MII(I.MII) {}
155 bundle_iterator() : MII(0) {}
157 Ty &operator*() const { return *MII; }
158 Ty *operator->() const { return &operator*(); }
160 operator Ty*() const { return MII; }
162 bool operator==(const bundle_iterator &x) const {
165 bool operator!=(const bundle_iterator &x) const {
166 return !operator==(x);
169 // Increment and decrement operators...
170 bundle_iterator &operator--() { // predecrement - Back up
173 } while (MII->isInsideBundle());
176 bundle_iterator &operator++() { // preincrement - Advance
179 } while (MII->isInsideBundle());
182 bundle_iterator operator--(int) { // postdecrement operators...
183 bundle_iterator tmp = *this;
186 } while (MII->isInsideBundle());
189 bundle_iterator operator++(int) { // postincrement operators...
190 bundle_iterator tmp = *this;
193 } while (MII->isInsideBundle());
197 IterTy getInsnIterator() const {
202 typedef Instructions::iterator insn_iterator;
203 typedef Instructions::const_iterator const_insn_iterator;
204 typedef std::reverse_iterator<insn_iterator> reverse_insn_iterator;
206 std::reverse_iterator<const_insn_iterator> const_reverse_insn_iterator;
209 bundle_iterator<MachineInstr,insn_iterator> iterator;
211 bundle_iterator<const MachineInstr,const_insn_iterator> const_iterator;
212 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
213 typedef std::reverse_iterator<iterator> reverse_iterator;
216 unsigned size() const { return (unsigned)Insts.size(); }
217 bool empty() const { return Insts.empty(); }
219 MachineInstr& front() { return Insts.front(); }
220 MachineInstr& back() { return Insts.back(); }
221 const MachineInstr& front() const { return Insts.front(); }
222 const MachineInstr& back() const { return Insts.back(); }
224 insn_iterator insn_begin() { return Insts.begin(); }
225 const_insn_iterator insn_begin() const { return Insts.begin(); }
226 insn_iterator insn_end() { return Insts.end(); }
227 const_insn_iterator insn_end() const { return Insts.end(); }
228 reverse_insn_iterator insn_rbegin() { return Insts.rbegin(); }
229 const_reverse_insn_iterator insn_rbegin() const { return Insts.rbegin(); }
230 reverse_insn_iterator insn_rend () { return Insts.rend(); }
231 const_reverse_insn_iterator insn_rend () const { return Insts.rend(); }
233 iterator begin() { return Insts.begin(); }
234 const_iterator begin() const { return Insts.begin(); }
236 insn_iterator II = insn_end();
237 if (II != insn_begin()) {
238 while (II->isInsideBundle())
243 const_iterator end() const {
244 const_insn_iterator II = insn_end();
245 if (II != insn_begin()) {
246 while (II->isInsideBundle())
251 reverse_iterator rbegin() {
252 reverse_insn_iterator II = insn_rbegin();
253 if (II != insn_rend()) {
254 while (II->isInsideBundle())
259 const_reverse_iterator rbegin() const {
260 const_reverse_insn_iterator II = insn_rbegin();
261 if (II != insn_rend()) {
262 while (II->isInsideBundle())
267 reverse_iterator rend () { return Insts.rend(); }
268 const_reverse_iterator rend () const { return Insts.rend(); }
271 // Machine-CFG iterators
272 typedef std::vector<MachineBasicBlock *>::iterator pred_iterator;
273 typedef std::vector<MachineBasicBlock *>::const_iterator const_pred_iterator;
274 typedef std::vector<MachineBasicBlock *>::iterator succ_iterator;
275 typedef std::vector<MachineBasicBlock *>::const_iterator const_succ_iterator;
276 typedef std::vector<MachineBasicBlock *>::reverse_iterator
277 pred_reverse_iterator;
278 typedef std::vector<MachineBasicBlock *>::const_reverse_iterator
279 const_pred_reverse_iterator;
280 typedef std::vector<MachineBasicBlock *>::reverse_iterator
281 succ_reverse_iterator;
282 typedef std::vector<MachineBasicBlock *>::const_reverse_iterator
283 const_succ_reverse_iterator;
285 pred_iterator pred_begin() { return Predecessors.begin(); }
286 const_pred_iterator pred_begin() const { return Predecessors.begin(); }
287 pred_iterator pred_end() { return Predecessors.end(); }
288 const_pred_iterator pred_end() const { return Predecessors.end(); }
289 pred_reverse_iterator pred_rbegin()
290 { return Predecessors.rbegin();}
291 const_pred_reverse_iterator pred_rbegin() const
292 { return Predecessors.rbegin();}
293 pred_reverse_iterator pred_rend()
294 { return Predecessors.rend(); }
295 const_pred_reverse_iterator pred_rend() const
296 { return Predecessors.rend(); }
297 unsigned pred_size() const {
298 return (unsigned)Predecessors.size();
300 bool pred_empty() const { return Predecessors.empty(); }
301 succ_iterator succ_begin() { return Successors.begin(); }
302 const_succ_iterator succ_begin() const { return Successors.begin(); }
303 succ_iterator succ_end() { return Successors.end(); }
304 const_succ_iterator succ_end() const { return Successors.end(); }
305 succ_reverse_iterator succ_rbegin()
306 { return Successors.rbegin(); }
307 const_succ_reverse_iterator succ_rbegin() const
308 { return Successors.rbegin(); }
309 succ_reverse_iterator succ_rend()
310 { return Successors.rend(); }
311 const_succ_reverse_iterator succ_rend() const
312 { return Successors.rend(); }
313 unsigned succ_size() const {
314 return (unsigned)Successors.size();
316 bool succ_empty() const { return Successors.empty(); }
318 // LiveIn management methods.
320 /// addLiveIn - Add the specified register as a live in. Note that it
321 /// is an error to add the same register to the same set more than once.
322 void addLiveIn(unsigned Reg) { LiveIns.push_back(Reg); }
324 /// removeLiveIn - Remove the specified register from the live in set.
326 void removeLiveIn(unsigned Reg);
328 /// isLiveIn - Return true if the specified register is in the live in set.
330 bool isLiveIn(unsigned Reg) const;
332 // Iteration support for live in sets. These sets are kept in sorted
333 // order by their register number.
334 typedef std::vector<unsigned>::const_iterator livein_iterator;
335 livein_iterator livein_begin() const { return LiveIns.begin(); }
336 livein_iterator livein_end() const { return LiveIns.end(); }
337 bool livein_empty() const { return LiveIns.empty(); }
339 /// getAlignment - Return alignment of the basic block.
340 /// The alignment is specified as log2(bytes).
342 unsigned getAlignment() const { return Alignment; }
344 /// setAlignment - Set alignment of the basic block.
345 /// The alignment is specified as log2(bytes).
347 void setAlignment(unsigned Align) { Alignment = Align; }
349 /// isLandingPad - Returns true if the block is a landing pad. That is
350 /// this basic block is entered via an exception handler.
351 bool isLandingPad() const { return IsLandingPad; }
353 /// setIsLandingPad - Indicates the block is a landing pad. That is
354 /// this basic block is entered via an exception handler.
355 void setIsLandingPad(bool V = true) { IsLandingPad = V; }
357 /// getLandingPadSuccessor - If this block has a successor that is a landing
358 /// pad, return it. Otherwise return NULL.
359 const MachineBasicBlock *getLandingPadSuccessor() const;
361 // Code Layout methods.
363 /// moveBefore/moveAfter - move 'this' block before or after the specified
364 /// block. This only moves the block, it does not modify the CFG or adjust
365 /// potential fall-throughs at the end of the block.
366 void moveBefore(MachineBasicBlock *NewAfter);
367 void moveAfter(MachineBasicBlock *NewBefore);
369 /// updateTerminator - Update the terminator instructions in block to account
370 /// for changes to the layout. If the block previously used a fallthrough,
371 /// it may now need a branch, and if it previously used branching it may now
372 /// be able to use a fallthrough.
373 void updateTerminator();
375 // Machine-CFG mutators
377 /// addSuccessor - Add succ as a successor of this MachineBasicBlock.
378 /// The Predecessors list of succ is automatically updated. WEIGHT
379 /// parameter is stored in Weights list and it may be used by
380 /// MachineBranchProbabilityInfo analysis to calculate branch probability.
382 void addSuccessor(MachineBasicBlock *succ, uint32_t weight = 0);
384 /// removeSuccessor - Remove successor from the successors list of this
385 /// MachineBasicBlock. The Predecessors list of succ is automatically updated.
387 void removeSuccessor(MachineBasicBlock *succ);
389 /// removeSuccessor - Remove specified successor from the successors list of
390 /// this MachineBasicBlock. The Predecessors list of succ is automatically
391 /// updated. Return the iterator to the element after the one removed.
393 succ_iterator removeSuccessor(succ_iterator I);
395 /// replaceSuccessor - Replace successor OLD with NEW and update weight info.
397 void replaceSuccessor(MachineBasicBlock *Old, MachineBasicBlock *New);
400 /// transferSuccessors - Transfers all the successors from MBB to this
401 /// machine basic block (i.e., copies all the successors fromMBB and
402 /// remove all the successors from fromMBB).
403 void transferSuccessors(MachineBasicBlock *fromMBB);
405 /// transferSuccessorsAndUpdatePHIs - Transfers all the successors, as
406 /// in transferSuccessors, and update PHI operands in the successor blocks
407 /// which refer to fromMBB to refer to this.
408 void transferSuccessorsAndUpdatePHIs(MachineBasicBlock *fromMBB);
410 /// isSuccessor - Return true if the specified MBB is a successor of this
412 bool isSuccessor(const MachineBasicBlock *MBB) const;
414 /// isLayoutSuccessor - Return true if the specified MBB will be emitted
415 /// immediately after this block, such that if this block exits by
416 /// falling through, control will transfer to the specified MBB. Note
417 /// that MBB need not be a successor at all, for example if this block
418 /// ends with an unconditional branch to some other block.
419 bool isLayoutSuccessor(const MachineBasicBlock *MBB) const;
421 /// canFallThrough - Return true if the block can implicitly transfer
422 /// control to the block after it by falling off the end of it. This should
423 /// return false if it can reach the block after it, but it uses an explicit
424 /// branch to do so (e.g., a table jump). True is a conservative answer.
425 bool canFallThrough();
427 /// Returns a pointer to the first instructon in this block that is not a
428 /// PHINode instruction. When adding instruction to the beginning of the
429 /// basic block, they should be added before the returned value, not before
430 /// the first instruction, which might be PHI.
431 /// Returns end() is there's no non-PHI instruction.
432 iterator getFirstNonPHI();
434 /// SkipPHIsAndLabels - Return the first instruction in MBB after I that is
435 /// not a PHI or a label. This is the correct point to insert copies at the
436 /// beginning of a basic block.
437 iterator SkipPHIsAndLabels(iterator I);
439 /// getFirstTerminator - returns an iterator to the first terminator
440 /// instruction of this basic block. If a terminator does not exist,
442 iterator getFirstTerminator();
443 const_iterator getFirstTerminator() const;
445 /// getFirstInsnTerminator - Same getFirstTerminator but it ignores bundles
446 /// and return an insn_iterator instead.
447 insn_iterator getFirstInsnTerminator();
449 /// getLastNonDebugInstr - returns an iterator to the last non-debug
450 /// instruction in the basic block, or end()
451 iterator getLastNonDebugInstr();
452 const_iterator getLastNonDebugInstr() const;
454 /// SplitCriticalEdge - Split the critical edge from this block to the
455 /// given successor block, and return the newly created block, or null
456 /// if splitting is not possible.
458 /// This function updates LiveVariables, MachineDominatorTree, and
459 /// MachineLoopInfo, as applicable.
460 MachineBasicBlock *SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P);
462 void pop_front() { Insts.pop_front(); }
463 void pop_back() { Insts.pop_back(); }
464 void push_back(MachineInstr *MI) { Insts.push_back(MI); }
466 template<typename IT>
467 void insert(insn_iterator I, IT S, IT E) {
468 Insts.insert(I, S, E);
470 insn_iterator insert(insn_iterator I, MachineInstr *M) {
471 return Insts.insert(I, M);
473 insn_iterator insertAfter(insn_iterator I, MachineInstr *M) {
474 return Insts.insertAfter(I, M);
477 template<typename IT>
478 void insert(iterator I, IT S, IT E) {
479 Insts.insert(I.getInsnIterator(), S, E);
481 iterator insert(iterator I, MachineInstr *M) {
482 return Insts.insert(I.getInsnIterator(), M);
484 iterator insertAfter(iterator I, MachineInstr *M) {
485 return Insts.insertAfter(I.getInsnIterator(), M);
488 // erase - Remove the specified element or range from the instruction list.
489 // These functions delete any instructions removed.
491 insn_iterator erase(insn_iterator I) {
492 return Insts.erase(I);
494 insn_iterator erase(insn_iterator I, insn_iterator E) {
495 return Insts.erase(I, E);
498 iterator erase(iterator I) {
499 return Insts.erase(I.getInsnIterator());
501 iterator erase(iterator I, iterator E) {
502 return Insts.erase(I.getInsnIterator(), E.getInsnIterator());
505 iterator erase(MachineInstr *I) { iterator MII(I); return erase(MII); }
506 MachineInstr *remove(MachineInstr *I) { return Insts.remove(I); }
507 void clear() { Insts.clear(); }
509 /// splice - Take an instruction from MBB 'Other' at the position From,
510 /// and insert it into this MBB right before 'where'.
511 void splice(insn_iterator where, MachineBasicBlock *Other,
512 insn_iterator From) {
513 Insts.splice(where, Other->Insts, From);
515 void splice(iterator where, MachineBasicBlock *Other, iterator From) {
516 Insts.splice(where.getInsnIterator(), Other->Insts, From.getInsnIterator());
519 /// splice - Take a block of instructions from MBB 'Other' in the range [From,
520 /// To), and insert them into this MBB right before 'where'.
521 void splice(insn_iterator where, MachineBasicBlock *Other, insn_iterator From,
523 Insts.splice(where, Other->Insts, From, To);
525 void splice(iterator where, MachineBasicBlock *Other, iterator From,
527 Insts.splice(where.getInsnIterator(), Other->Insts,
528 From.getInsnIterator(), To.getInsnIterator());
531 /// removeFromParent - This method unlinks 'this' from the containing
532 /// function, and returns it, but does not delete it.
533 MachineBasicBlock *removeFromParent();
535 /// eraseFromParent - This method unlinks 'this' from the containing
536 /// function and deletes it.
537 void eraseFromParent();
539 /// ReplaceUsesOfBlockWith - Given a machine basic block that branched to
540 /// 'Old', change the code and CFG so that it branches to 'New' instead.
541 void ReplaceUsesOfBlockWith(MachineBasicBlock *Old, MachineBasicBlock *New);
543 /// CorrectExtraCFGEdges - Various pieces of code can cause excess edges in
544 /// the CFG to be inserted. If we have proven that MBB can only branch to
545 /// DestA and DestB, remove any other MBB successors from the CFG. DestA and
546 /// DestB can be null. Besides DestA and DestB, retain other edges leading
547 /// to LandingPads (currently there can be only one; we don't check or require
548 /// that here). Note it is possible that DestA and/or DestB are LandingPads.
549 bool CorrectExtraCFGEdges(MachineBasicBlock *DestA,
550 MachineBasicBlock *DestB,
553 /// findDebugLoc - find the next valid DebugLoc starting at MBBI, skipping
554 /// any DBG_VALUE instructions. Return UnknownLoc if there is none.
555 DebugLoc findDebugLoc(insn_iterator MBBI);
556 DebugLoc findDebugLoc(iterator MBBI) {
557 return findDebugLoc(MBBI.getInsnIterator());
560 // Debugging methods.
562 void print(raw_ostream &OS, SlotIndexes* = 0) const;
564 /// getNumber - MachineBasicBlocks are uniquely numbered at the function
565 /// level, unless they're not in a MachineFunction yet, in which case this
568 int getNumber() const { return Number; }
569 void setNumber(int N) { Number = N; }
571 /// getSymbol - Return the MCSymbol for this basic block.
573 MCSymbol *getSymbol() const;
577 /// getWeightIterator - Return weight iterator corresponding to the I
578 /// successor iterator.
579 weight_iterator getWeightIterator(succ_iterator I);
581 friend class MachineBranchProbabilityInfo;
583 /// getSuccWeight - Return weight of the edge from this block to MBB. This
584 /// method should NOT be called directly, but by using getEdgeWeight method
585 /// from MachineBranchProbabilityInfo class.
586 uint32_t getSuccWeight(MachineBasicBlock *succ);
589 // Methods used to maintain doubly linked list of blocks...
590 friend struct ilist_traits<MachineBasicBlock>;
592 // Machine-CFG mutators
594 /// addPredecessor - Remove pred as a predecessor of this MachineBasicBlock.
595 /// Don't do this unless you know what you're doing, because it doesn't
596 /// update pred's successors list. Use pred->addSuccessor instead.
598 void addPredecessor(MachineBasicBlock *pred);
600 /// removePredecessor - Remove pred as a predecessor of this
601 /// MachineBasicBlock. Don't do this unless you know what you're
602 /// doing, because it doesn't update pred's successors list. Use
603 /// pred->removeSuccessor instead.
605 void removePredecessor(MachineBasicBlock *pred);
608 raw_ostream& operator<<(raw_ostream &OS, const MachineBasicBlock &MBB);
610 void WriteAsOperand(raw_ostream &, const MachineBasicBlock*, bool t);
612 // This is useful when building IndexedMaps keyed on basic block pointers.
613 struct MBB2NumberFunctor :
614 public std::unary_function<const MachineBasicBlock*, unsigned> {
615 unsigned operator()(const MachineBasicBlock *MBB) const {
616 return MBB->getNumber();
620 //===--------------------------------------------------------------------===//
621 // GraphTraits specializations for machine basic block graphs (machine-CFGs)
622 //===--------------------------------------------------------------------===//
624 // Provide specializations of GraphTraits to be able to treat a
625 // MachineFunction as a graph of MachineBasicBlocks...
628 template <> struct GraphTraits<MachineBasicBlock *> {
629 typedef MachineBasicBlock NodeType;
630 typedef MachineBasicBlock::succ_iterator ChildIteratorType;
632 static NodeType *getEntryNode(MachineBasicBlock *BB) { return BB; }
633 static inline ChildIteratorType child_begin(NodeType *N) {
634 return N->succ_begin();
636 static inline ChildIteratorType child_end(NodeType *N) {
637 return N->succ_end();
641 template <> struct GraphTraits<const MachineBasicBlock *> {
642 typedef const MachineBasicBlock NodeType;
643 typedef MachineBasicBlock::const_succ_iterator ChildIteratorType;
645 static NodeType *getEntryNode(const MachineBasicBlock *BB) { return BB; }
646 static inline ChildIteratorType child_begin(NodeType *N) {
647 return N->succ_begin();
649 static inline ChildIteratorType child_end(NodeType *N) {
650 return N->succ_end();
654 // Provide specializations of GraphTraits to be able to treat a
655 // MachineFunction as a graph of MachineBasicBlocks... and to walk it
656 // in inverse order. Inverse order for a function is considered
657 // to be when traversing the predecessor edges of a MBB
658 // instead of the successor edges.
660 template <> struct GraphTraits<Inverse<MachineBasicBlock*> > {
661 typedef MachineBasicBlock NodeType;
662 typedef MachineBasicBlock::pred_iterator ChildIteratorType;
663 static NodeType *getEntryNode(Inverse<MachineBasicBlock *> G) {
666 static inline ChildIteratorType child_begin(NodeType *N) {
667 return N->pred_begin();
669 static inline ChildIteratorType child_end(NodeType *N) {
670 return N->pred_end();
674 template <> struct GraphTraits<Inverse<const MachineBasicBlock*> > {
675 typedef const MachineBasicBlock NodeType;
676 typedef MachineBasicBlock::const_pred_iterator ChildIteratorType;
677 static NodeType *getEntryNode(Inverse<const MachineBasicBlock*> G) {
680 static inline ChildIteratorType child_begin(NodeType *N) {
681 return N->pred_begin();
683 static inline ChildIteratorType child_end(NodeType *N) {
684 return N->pred_end();
688 } // End llvm namespace