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;
80 typedef std::vector<uint32_t>::const_iterator const_weight_iterator;
82 /// LiveIns - Keep track of the physical registers that are livein of
84 std::vector<unsigned> LiveIns;
86 /// Alignment - Alignment of the basic block. Zero if the basic block does
87 /// not need to be aligned.
88 /// The alignment is specified as log2(bytes).
91 /// IsLandingPad - Indicate that this basic block is entered via an
92 /// exception handler.
95 /// AddressTaken - Indicate that this basic block is potentially the
96 /// target of an indirect branch.
99 // Intrusive list support
100 MachineBasicBlock() {}
102 explicit MachineBasicBlock(MachineFunction &mf, const BasicBlock *bb);
104 ~MachineBasicBlock();
106 // MachineBasicBlocks are allocated and owned by MachineFunction.
107 friend class MachineFunction;
110 /// getBasicBlock - Return the LLVM basic block that this instance
111 /// corresponded to originally. Note that this may be NULL if this instance
112 /// does not correspond directly to an LLVM basic block.
114 const BasicBlock *getBasicBlock() const { return BB; }
116 /// getName - Return the name of the corresponding LLVM basic block, or
118 StringRef getName() const;
120 /// getFullName - Return a formatted string to identify this block and its
122 std::string getFullName() const;
124 /// hasAddressTaken - Test whether this block is potentially the target
125 /// of an indirect branch.
126 bool hasAddressTaken() const { return AddressTaken; }
128 /// setHasAddressTaken - Set this block to reflect that it potentially
129 /// is the target of an indirect branch.
130 void setHasAddressTaken() { AddressTaken = true; }
132 /// getParent - Return the MachineFunction containing this basic block.
134 const MachineFunction *getParent() const { return xParent; }
135 MachineFunction *getParent() { return xParent; }
138 /// bundle_iterator - MachineBasicBlock iterator that automatically skips over
139 /// MIs that are inside bundles (i.e. walk top level MIs only).
140 template<typename Ty, typename IterTy>
141 class bundle_iterator
142 : public std::iterator<std::bidirectional_iterator_tag, Ty, ptrdiff_t> {
146 bundle_iterator(IterTy mii) : MII(mii) {}
148 bundle_iterator(Ty &mi) : MII(mi) {
149 assert(!mi.isInsideBundle() &&
150 "It's not legal to initialize bundle_iterator with a bundled MI");
152 bundle_iterator(Ty *mi) : MII(mi) {
153 assert((!mi || !mi->isInsideBundle()) &&
154 "It's not legal to initialize bundle_iterator with a bundled MI");
156 // Template allows conversion from const to nonconst.
157 template<class OtherTy, class OtherIterTy>
158 bundle_iterator(const bundle_iterator<OtherTy, OtherIterTy> &I)
159 : MII(I.getInstrIterator()) {}
160 bundle_iterator() : MII(0) {}
162 Ty &operator*() const { return *MII; }
163 Ty *operator->() const { return &operator*(); }
165 operator Ty*() const { return MII; }
167 bool operator==(const bundle_iterator &x) const {
170 bool operator!=(const bundle_iterator &x) const {
171 return !operator==(x);
174 // Increment and decrement operators...
175 bundle_iterator &operator--() { // predecrement - Back up
177 while (MII->isInsideBundle());
180 bundle_iterator &operator++() { // preincrement - Advance
181 IterTy E = MII->getParent()->instr_end();
183 while (MII != E && MII->isInsideBundle());
186 bundle_iterator operator--(int) { // postdecrement operators...
187 bundle_iterator tmp = *this;
191 bundle_iterator operator++(int) { // postincrement operators...
192 bundle_iterator tmp = *this;
197 IterTy getInstrIterator() const {
202 typedef Instructions::iterator instr_iterator;
203 typedef Instructions::const_iterator const_instr_iterator;
204 typedef std::reverse_iterator<instr_iterator> reverse_instr_iterator;
206 std::reverse_iterator<const_instr_iterator> const_reverse_instr_iterator;
209 bundle_iterator<MachineInstr,instr_iterator> iterator;
211 bundle_iterator<const MachineInstr,const_instr_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 instr_iterator instr_begin() { return Insts.begin(); }
225 const_instr_iterator instr_begin() const { return Insts.begin(); }
226 instr_iterator instr_end() { return Insts.end(); }
227 const_instr_iterator instr_end() const { return Insts.end(); }
228 reverse_instr_iterator instr_rbegin() { return Insts.rbegin(); }
229 const_reverse_instr_iterator instr_rbegin() const { return Insts.rbegin(); }
230 reverse_instr_iterator instr_rend () { return Insts.rend(); }
231 const_reverse_instr_iterator instr_rend () const { return Insts.rend(); }
233 iterator begin() { return instr_begin(); }
234 const_iterator begin() const { return instr_begin(); }
235 iterator end () { return instr_end(); }
236 const_iterator end () const { return instr_end(); }
237 reverse_iterator rbegin() { return instr_rbegin(); }
238 const_reverse_iterator rbegin() const { return instr_rbegin(); }
239 reverse_iterator rend () { return instr_rend(); }
240 const_reverse_iterator rend () const { return instr_rend(); }
243 // Machine-CFG iterators
244 typedef std::vector<MachineBasicBlock *>::iterator pred_iterator;
245 typedef std::vector<MachineBasicBlock *>::const_iterator const_pred_iterator;
246 typedef std::vector<MachineBasicBlock *>::iterator succ_iterator;
247 typedef std::vector<MachineBasicBlock *>::const_iterator const_succ_iterator;
248 typedef std::vector<MachineBasicBlock *>::reverse_iterator
249 pred_reverse_iterator;
250 typedef std::vector<MachineBasicBlock *>::const_reverse_iterator
251 const_pred_reverse_iterator;
252 typedef std::vector<MachineBasicBlock *>::reverse_iterator
253 succ_reverse_iterator;
254 typedef std::vector<MachineBasicBlock *>::const_reverse_iterator
255 const_succ_reverse_iterator;
257 pred_iterator pred_begin() { return Predecessors.begin(); }
258 const_pred_iterator pred_begin() const { return Predecessors.begin(); }
259 pred_iterator pred_end() { return Predecessors.end(); }
260 const_pred_iterator pred_end() const { return Predecessors.end(); }
261 pred_reverse_iterator pred_rbegin()
262 { return Predecessors.rbegin();}
263 const_pred_reverse_iterator pred_rbegin() const
264 { return Predecessors.rbegin();}
265 pred_reverse_iterator pred_rend()
266 { return Predecessors.rend(); }
267 const_pred_reverse_iterator pred_rend() const
268 { return Predecessors.rend(); }
269 unsigned pred_size() const {
270 return (unsigned)Predecessors.size();
272 bool pred_empty() const { return Predecessors.empty(); }
273 succ_iterator succ_begin() { return Successors.begin(); }
274 const_succ_iterator succ_begin() const { return Successors.begin(); }
275 succ_iterator succ_end() { return Successors.end(); }
276 const_succ_iterator succ_end() const { return Successors.end(); }
277 succ_reverse_iterator succ_rbegin()
278 { return Successors.rbegin(); }
279 const_succ_reverse_iterator succ_rbegin() const
280 { return Successors.rbegin(); }
281 succ_reverse_iterator succ_rend()
282 { return Successors.rend(); }
283 const_succ_reverse_iterator succ_rend() const
284 { return Successors.rend(); }
285 unsigned succ_size() const {
286 return (unsigned)Successors.size();
288 bool succ_empty() const { return Successors.empty(); }
290 // LiveIn management methods.
292 /// addLiveIn - Add the specified register as a live in. Note that it
293 /// is an error to add the same register to the same set more than once.
294 void addLiveIn(unsigned Reg) { LiveIns.push_back(Reg); }
296 /// removeLiveIn - Remove the specified register from the live in set.
298 void removeLiveIn(unsigned Reg);
300 /// isLiveIn - Return true if the specified register is in the live in set.
302 bool isLiveIn(unsigned Reg) const;
304 // Iteration support for live in sets. These sets are kept in sorted
305 // order by their register number.
306 typedef std::vector<unsigned>::const_iterator livein_iterator;
307 livein_iterator livein_begin() const { return LiveIns.begin(); }
308 livein_iterator livein_end() const { return LiveIns.end(); }
309 bool livein_empty() const { return LiveIns.empty(); }
311 /// getAlignment - Return alignment of the basic block.
312 /// The alignment is specified as log2(bytes).
314 unsigned getAlignment() const { return Alignment; }
316 /// setAlignment - Set alignment of the basic block.
317 /// The alignment is specified as log2(bytes).
319 void setAlignment(unsigned Align) { Alignment = Align; }
321 /// isLandingPad - Returns true if the block is a landing pad. That is
322 /// this basic block is entered via an exception handler.
323 bool isLandingPad() const { return IsLandingPad; }
325 /// setIsLandingPad - Indicates the block is a landing pad. That is
326 /// this basic block is entered via an exception handler.
327 void setIsLandingPad(bool V = true) { IsLandingPad = V; }
329 /// getLandingPadSuccessor - If this block has a successor that is a landing
330 /// pad, return it. Otherwise return NULL.
331 const MachineBasicBlock *getLandingPadSuccessor() const;
333 // Code Layout methods.
335 /// moveBefore/moveAfter - move 'this' block before or after the specified
336 /// block. This only moves the block, it does not modify the CFG or adjust
337 /// potential fall-throughs at the end of the block.
338 void moveBefore(MachineBasicBlock *NewAfter);
339 void moveAfter(MachineBasicBlock *NewBefore);
341 /// updateTerminator - Update the terminator instructions in block to account
342 /// for changes to the layout. If the block previously used a fallthrough,
343 /// it may now need a branch, and if it previously used branching it may now
344 /// be able to use a fallthrough.
345 void updateTerminator();
347 // Machine-CFG mutators
349 /// addSuccessor - Add succ as a successor of this MachineBasicBlock.
350 /// The Predecessors list of succ is automatically updated. WEIGHT
351 /// parameter is stored in Weights list and it may be used by
352 /// MachineBranchProbabilityInfo analysis to calculate branch probability.
354 void addSuccessor(MachineBasicBlock *succ, uint32_t weight = 0);
356 /// removeSuccessor - Remove successor from the successors list of this
357 /// MachineBasicBlock. The Predecessors list of succ is automatically updated.
359 void removeSuccessor(MachineBasicBlock *succ);
361 /// removeSuccessor - Remove specified successor from the successors list of
362 /// this MachineBasicBlock. The Predecessors list of succ is automatically
363 /// updated. Return the iterator to the element after the one removed.
365 succ_iterator removeSuccessor(succ_iterator I);
367 /// replaceSuccessor - Replace successor OLD with NEW and update weight info.
369 void replaceSuccessor(MachineBasicBlock *Old, MachineBasicBlock *New);
372 /// transferSuccessors - Transfers all the successors from MBB to this
373 /// machine basic block (i.e., copies all the successors fromMBB and
374 /// remove all the successors from fromMBB).
375 void transferSuccessors(MachineBasicBlock *fromMBB);
377 /// transferSuccessorsAndUpdatePHIs - Transfers all the successors, as
378 /// in transferSuccessors, and update PHI operands in the successor blocks
379 /// which refer to fromMBB to refer to this.
380 void transferSuccessorsAndUpdatePHIs(MachineBasicBlock *fromMBB);
382 /// isSuccessor - Return true if the specified MBB is a successor of this
384 bool isSuccessor(const MachineBasicBlock *MBB) const;
386 /// isLayoutSuccessor - Return true if the specified MBB will be emitted
387 /// immediately after this block, such that if this block exits by
388 /// falling through, control will transfer to the specified MBB. Note
389 /// that MBB need not be a successor at all, for example if this block
390 /// ends with an unconditional branch to some other block.
391 bool isLayoutSuccessor(const MachineBasicBlock *MBB) const;
393 /// canFallThrough - Return true if the block can implicitly transfer
394 /// control to the block after it by falling off the end of it. This should
395 /// return false if it can reach the block after it, but it uses an explicit
396 /// branch to do so (e.g., a table jump). True is a conservative answer.
397 bool canFallThrough();
399 /// Returns a pointer to the first instructon in this block that is not a
400 /// PHINode instruction. When adding instruction to the beginning of the
401 /// basic block, they should be added before the returned value, not before
402 /// the first instruction, which might be PHI.
403 /// Returns end() is there's no non-PHI instruction.
404 iterator getFirstNonPHI();
406 /// SkipPHIsAndLabels - Return the first instruction in MBB after I that is
407 /// not a PHI or a label. This is the correct point to insert copies at the
408 /// beginning of a basic block.
409 iterator SkipPHIsAndLabels(iterator I);
411 /// getFirstTerminator - returns an iterator to the first terminator
412 /// instruction of this basic block. If a terminator does not exist,
414 iterator getFirstTerminator();
415 const_iterator getFirstTerminator() const;
417 /// getFirstInstrTerminator - Same getFirstTerminator but it ignores bundles
418 /// and return an instr_iterator instead.
419 instr_iterator getFirstInstrTerminator();
421 /// getLastNonDebugInstr - returns an iterator to the last non-debug
422 /// instruction in the basic block, or end()
423 iterator getLastNonDebugInstr();
424 const_iterator getLastNonDebugInstr() const;
426 /// SplitCriticalEdge - Split the critical edge from this block to the
427 /// given successor block, and return the newly created block, or null
428 /// if splitting is not possible.
430 /// This function updates LiveVariables, MachineDominatorTree, and
431 /// MachineLoopInfo, as applicable.
432 MachineBasicBlock *SplitCriticalEdge(MachineBasicBlock *Succ, Pass *P);
434 void pop_front() { Insts.pop_front(); }
435 void pop_back() { Insts.pop_back(); }
436 void push_back(MachineInstr *MI) { Insts.push_back(MI); }
438 template<typename IT>
439 void insert(instr_iterator I, IT S, IT E) {
440 Insts.insert(I, S, E);
442 instr_iterator insert(instr_iterator I, MachineInstr *M) {
443 return Insts.insert(I, M);
445 instr_iterator insertAfter(instr_iterator I, MachineInstr *M) {
446 return Insts.insertAfter(I, M);
449 template<typename IT>
450 void insert(iterator I, IT S, IT E) {
451 Insts.insert(I.getInstrIterator(), S, E);
453 iterator insert(iterator I, MachineInstr *M) {
454 return Insts.insert(I.getInstrIterator(), M);
456 iterator insertAfter(iterator I, MachineInstr *M) {
457 return Insts.insertAfter(I.getInstrIterator(), M);
460 /// erase - Remove the specified element or range from the instruction list.
461 /// These functions delete any instructions removed.
463 instr_iterator erase(instr_iterator I) {
464 return Insts.erase(I);
466 instr_iterator erase(instr_iterator I, instr_iterator E) {
467 return Insts.erase(I, E);
469 instr_iterator erase_instr(MachineInstr *I) {
470 instr_iterator MII(I);
474 iterator erase(iterator I);
475 iterator erase(iterator I, iterator E) {
476 return Insts.erase(I.getInstrIterator(), E.getInstrIterator());
478 iterator erase(MachineInstr *I) {
483 /// remove - Remove the instruction from the instruction list. This function
484 /// does not delete the instruction. WARNING: Note, if the specified
485 /// instruction is a bundle this function will remove all the bundled
486 /// instructions as well. It is up to the caller to keep a list of the
487 /// bundled instructions and re-insert them if desired. This function is
488 /// *not recommended* for manipulating instructions with bundles. Use
490 MachineInstr *remove(MachineInstr *I);
495 /// splice - Take an instruction from MBB 'Other' at the position From,
496 /// and insert it into this MBB right before 'where'.
497 void splice(instr_iterator where, MachineBasicBlock *Other,
498 instr_iterator From) {
499 Insts.splice(where, Other->Insts, From);
501 void splice(iterator where, MachineBasicBlock *Other, iterator From);
503 /// splice - Take a block of instructions from MBB 'Other' in the range [From,
504 /// To), and insert them into this MBB right before 'where'.
505 void splice(instr_iterator where, MachineBasicBlock *Other, instr_iterator From,
507 Insts.splice(where, Other->Insts, From, To);
509 void splice(iterator where, MachineBasicBlock *Other, iterator From,
511 Insts.splice(where.getInstrIterator(), Other->Insts,
512 From.getInstrIterator(), To.getInstrIterator());
515 /// removeFromParent - This method unlinks 'this' from the containing
516 /// function, and returns it, but does not delete it.
517 MachineBasicBlock *removeFromParent();
519 /// eraseFromParent - This method unlinks 'this' from the containing
520 /// function and deletes it.
521 void eraseFromParent();
523 /// ReplaceUsesOfBlockWith - Given a machine basic block that branched to
524 /// 'Old', change the code and CFG so that it branches to 'New' instead.
525 void ReplaceUsesOfBlockWith(MachineBasicBlock *Old, MachineBasicBlock *New);
527 /// CorrectExtraCFGEdges - Various pieces of code can cause excess edges in
528 /// the CFG to be inserted. If we have proven that MBB can only branch to
529 /// DestA and DestB, remove any other MBB successors from the CFG. DestA and
530 /// DestB can be null. Besides DestA and DestB, retain other edges leading
531 /// to LandingPads (currently there can be only one; we don't check or require
532 /// that here). Note it is possible that DestA and/or DestB are LandingPads.
533 bool CorrectExtraCFGEdges(MachineBasicBlock *DestA,
534 MachineBasicBlock *DestB,
537 /// findDebugLoc - find the next valid DebugLoc starting at MBBI, skipping
538 /// any DBG_VALUE instructions. Return UnknownLoc if there is none.
539 DebugLoc findDebugLoc(instr_iterator MBBI);
540 DebugLoc findDebugLoc(iterator MBBI) {
541 return findDebugLoc(MBBI.getInstrIterator());
544 // Debugging methods.
546 void print(raw_ostream &OS, SlotIndexes* = 0) const;
548 /// getNumber - MachineBasicBlocks are uniquely numbered at the function
549 /// level, unless they're not in a MachineFunction yet, in which case this
552 int getNumber() const { return Number; }
553 void setNumber(int N) { Number = N; }
555 /// getSymbol - Return the MCSymbol for this basic block.
557 MCSymbol *getSymbol() const;
561 /// getWeightIterator - Return weight iterator corresponding to the I
562 /// successor iterator.
563 weight_iterator getWeightIterator(succ_iterator I);
564 const_weight_iterator getWeightIterator(const_succ_iterator I) const;
566 friend class MachineBranchProbabilityInfo;
568 /// getSuccWeight - Return weight of the edge from this block to MBB. This
569 /// method should NOT be called directly, but by using getEdgeWeight method
570 /// from MachineBranchProbabilityInfo class.
571 uint32_t getSuccWeight(const MachineBasicBlock *succ) const;
574 // Methods used to maintain doubly linked list of blocks...
575 friend struct ilist_traits<MachineBasicBlock>;
577 // Machine-CFG mutators
579 /// addPredecessor - Remove pred as a predecessor of this MachineBasicBlock.
580 /// Don't do this unless you know what you're doing, because it doesn't
581 /// update pred's successors list. Use pred->addSuccessor instead.
583 void addPredecessor(MachineBasicBlock *pred);
585 /// removePredecessor - Remove pred as a predecessor of this
586 /// MachineBasicBlock. Don't do this unless you know what you're
587 /// doing, because it doesn't update pred's successors list. Use
588 /// pred->removeSuccessor instead.
590 void removePredecessor(MachineBasicBlock *pred);
593 raw_ostream& operator<<(raw_ostream &OS, const MachineBasicBlock &MBB);
595 void WriteAsOperand(raw_ostream &, const MachineBasicBlock*, bool t);
597 // This is useful when building IndexedMaps keyed on basic block pointers.
598 struct MBB2NumberFunctor :
599 public std::unary_function<const MachineBasicBlock*, unsigned> {
600 unsigned operator()(const MachineBasicBlock *MBB) const {
601 return MBB->getNumber();
605 //===--------------------------------------------------------------------===//
606 // GraphTraits specializations for machine basic block graphs (machine-CFGs)
607 //===--------------------------------------------------------------------===//
609 // Provide specializations of GraphTraits to be able to treat a
610 // MachineFunction as a graph of MachineBasicBlocks...
613 template <> struct GraphTraits<MachineBasicBlock *> {
614 typedef MachineBasicBlock NodeType;
615 typedef MachineBasicBlock::succ_iterator ChildIteratorType;
617 static NodeType *getEntryNode(MachineBasicBlock *BB) { return BB; }
618 static inline ChildIteratorType child_begin(NodeType *N) {
619 return N->succ_begin();
621 static inline ChildIteratorType child_end(NodeType *N) {
622 return N->succ_end();
626 template <> struct GraphTraits<const MachineBasicBlock *> {
627 typedef const MachineBasicBlock NodeType;
628 typedef MachineBasicBlock::const_succ_iterator ChildIteratorType;
630 static NodeType *getEntryNode(const MachineBasicBlock *BB) { return BB; }
631 static inline ChildIteratorType child_begin(NodeType *N) {
632 return N->succ_begin();
634 static inline ChildIteratorType child_end(NodeType *N) {
635 return N->succ_end();
639 // Provide specializations of GraphTraits to be able to treat a
640 // MachineFunction as a graph of MachineBasicBlocks... and to walk it
641 // in inverse order. Inverse order for a function is considered
642 // to be when traversing the predecessor edges of a MBB
643 // instead of the successor edges.
645 template <> struct GraphTraits<Inverse<MachineBasicBlock*> > {
646 typedef MachineBasicBlock NodeType;
647 typedef MachineBasicBlock::pred_iterator ChildIteratorType;
648 static NodeType *getEntryNode(Inverse<MachineBasicBlock *> G) {
651 static inline ChildIteratorType child_begin(NodeType *N) {
652 return N->pred_begin();
654 static inline ChildIteratorType child_end(NodeType *N) {
655 return N->pred_end();
659 template <> struct GraphTraits<Inverse<const MachineBasicBlock*> > {
660 typedef const MachineBasicBlock NodeType;
661 typedef MachineBasicBlock::const_pred_iterator ChildIteratorType;
662 static NodeType *getEntryNode(Inverse<const MachineBasicBlock*> G) {
665 static inline ChildIteratorType child_begin(NodeType *N) {
666 return N->pred_begin();
668 static inline ChildIteratorType child_end(NodeType *N) {
669 return N->pred_end();
673 } // End llvm namespace