2003-09-30 18:37:50 +00:00
|
|
|
//===- llvm/Analysis/LoopInfo.h - Natural Loop Calculator -------*- C++ -*-===//
|
2005-04-21 20:19:05 +00:00
|
|
|
//
|
2003-10-20 20:19:47 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by the LLVM research group and is distributed under
|
|
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
2005-04-21 20:19:05 +00:00
|
|
|
//
|
2003-10-20 20:19:47 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2001-11-26 18:41:20 +00:00
|
|
|
//
|
|
|
|
// This file defines the LoopInfo class that is used to identify natural loops
|
2003-02-27 00:37:22 +00:00
|
|
|
// and determine the loop depth of various nodes of the CFG. Note that natural
|
2004-04-12 20:26:17 +00:00
|
|
|
// loops may actually be several loops that share the same header node.
|
2003-02-27 00:37:22 +00:00
|
|
|
//
|
|
|
|
// This analysis calculates the nesting structure of loops in a function. For
|
|
|
|
// each natural loop identified, this analysis identifies natural loops
|
2004-04-19 03:03:19 +00:00
|
|
|
// contained entirely within the loop and the basic blocks the make up the loop.
|
2003-02-27 00:37:22 +00:00
|
|
|
//
|
2004-04-19 03:03:19 +00:00
|
|
|
// It can calculate on the fly various bits of information, for example:
|
|
|
|
//
|
|
|
|
// * whether there is a preheader for the loop
|
|
|
|
// * the number of back edges to the header
|
|
|
|
// * whether or not a particular block branches out of the loop
|
|
|
|
// * the successor blocks of the loop
|
|
|
|
// * the loop depth
|
|
|
|
// * the trip count
|
|
|
|
// * etc...
|
2001-11-26 18:41:20 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_ANALYSIS_LOOP_INFO_H
|
|
|
|
#define LLVM_ANALYSIS_LOOP_INFO_H
|
|
|
|
|
2002-01-30 23:27:55 +00:00
|
|
|
#include "llvm/Pass.h"
|
2004-09-01 22:55:40 +00:00
|
|
|
#include "llvm/ADT/GraphTraits.h"
|
2001-11-26 18:41:20 +00:00
|
|
|
|
2003-11-11 22:41:34 +00:00
|
|
|
namespace llvm {
|
|
|
|
|
2006-11-05 19:31:28 +00:00
|
|
|
class ETForest;
|
2002-04-28 16:19:42 +00:00
|
|
|
class LoopInfo;
|
2004-04-15 15:15:40 +00:00
|
|
|
class PHINode;
|
2004-04-18 22:45:16 +00:00
|
|
|
class Instruction;
|
2001-11-26 18:41:20 +00:00
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
2005-04-21 20:19:05 +00:00
|
|
|
/// Loop class - Instances of this class are used to represent loops that are
|
|
|
|
/// detected in the flow graph
|
2002-09-26 05:32:43 +00:00
|
|
|
///
|
2001-11-26 18:41:20 +00:00
|
|
|
class Loop {
|
|
|
|
Loop *ParentLoop;
|
2002-01-20 22:54:45 +00:00
|
|
|
std::vector<Loop*> SubLoops; // Loops contained entirely within this one
|
2003-08-16 20:57:16 +00:00
|
|
|
std::vector<BasicBlock*> Blocks; // First entry is the header node
|
2001-11-26 18:41:20 +00:00
|
|
|
|
|
|
|
Loop(const Loop &); // DO NOT IMPLEMENT
|
|
|
|
const Loop &operator=(const Loop &); // DO NOT IMPLEMENT
|
|
|
|
public:
|
2004-04-12 20:26:17 +00:00
|
|
|
/// Loop ctor - This creates an empty loop.
|
2004-04-19 03:03:19 +00:00
|
|
|
Loop() : ParentLoop(0) {}
|
2004-04-18 05:37:42 +00:00
|
|
|
~Loop() {
|
|
|
|
for (unsigned i = 0, e = SubLoops.size(); i != e; ++i)
|
|
|
|
delete SubLoops[i];
|
|
|
|
}
|
2001-11-26 18:41:20 +00:00
|
|
|
|
2004-04-19 03:03:19 +00:00
|
|
|
unsigned getLoopDepth() const {
|
|
|
|
unsigned D = 0;
|
|
|
|
for (const Loop *CurLoop = this; CurLoop; CurLoop = CurLoop->ParentLoop)
|
|
|
|
++D;
|
|
|
|
return D;
|
|
|
|
}
|
2003-08-16 20:57:16 +00:00
|
|
|
BasicBlock *getHeader() const { return Blocks.front(); }
|
|
|
|
Loop *getParentLoop() const { return ParentLoop; }
|
2001-11-26 18:41:20 +00:00
|
|
|
|
2002-09-26 05:32:43 +00:00
|
|
|
/// contains - Return true of the specified basic block is in this loop
|
2004-01-30 17:22:50 +00:00
|
|
|
///
|
2002-06-03 22:10:48 +00:00
|
|
|
bool contains(const BasicBlock *BB) const;
|
2001-11-26 18:41:20 +00:00
|
|
|
|
2004-01-08 00:09:44 +00:00
|
|
|
/// iterator/begin/end - Return the loops contained entirely within this loop.
|
2002-09-26 05:32:43 +00:00
|
|
|
///
|
2005-05-01 16:22:41 +00:00
|
|
|
const std::vector<Loop*> &getSubLoops() const { return SubLoops; }
|
2004-01-08 00:09:44 +00:00
|
|
|
typedef std::vector<Loop*>::const_iterator iterator;
|
|
|
|
iterator begin() const { return SubLoops.begin(); }
|
|
|
|
iterator end() const { return SubLoops.end(); }
|
2003-02-27 00:37:22 +00:00
|
|
|
|
|
|
|
/// getBlocks - Get a list of the basic blocks which make up this loop.
|
|
|
|
///
|
|
|
|
const std::vector<BasicBlock*> &getBlocks() const { return Blocks; }
|
2004-04-18 23:37:03 +00:00
|
|
|
typedef std::vector<BasicBlock*>::const_iterator block_iterator;
|
|
|
|
block_iterator block_begin() const { return Blocks.begin(); }
|
|
|
|
block_iterator block_end() const { return Blocks.end(); }
|
2003-02-27 00:37:22 +00:00
|
|
|
|
2002-09-26 05:32:43 +00:00
|
|
|
/// isLoopExit - True if terminator in the block can branch to another block
|
2004-04-18 22:14:10 +00:00
|
|
|
/// that is outside of the current loop.
|
2003-02-27 00:37:22 +00:00
|
|
|
///
|
2002-10-11 05:31:10 +00:00
|
|
|
bool isLoopExit(const BasicBlock *BB) const;
|
|
|
|
|
2003-02-27 00:37:22 +00:00
|
|
|
/// getNumBackEdges - Calculate the number of back edges to the loop header
|
|
|
|
///
|
2002-10-11 05:31:10 +00:00
|
|
|
unsigned getNumBackEdges() const;
|
2002-09-25 19:10:06 +00:00
|
|
|
|
2004-04-18 22:45:16 +00:00
|
|
|
/// isLoopInvariant - Return true if the specified value is loop invariant
|
|
|
|
///
|
|
|
|
bool isLoopInvariant(Value *V) const;
|
2006-06-11 09:32:57 +00:00
|
|
|
|
2004-04-15 15:15:40 +00:00
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
// APIs for simple analysis of the loop.
|
|
|
|
//
|
|
|
|
// Note that all of these methods can fail on general loops (ie, there may not
|
|
|
|
// be a preheader, etc). For best success, the loop simplification and
|
|
|
|
// induction variable canonicalization pass should be used to normalize loops
|
|
|
|
// for easy analysis. These methods assume canonical loops.
|
|
|
|
|
2006-10-28 01:24:05 +00:00
|
|
|
/// getExitingBlocks - Return all blocks inside the loop that have successors
|
|
|
|
/// outside of the loop. These are the blocks _inside of the current loop_
|
|
|
|
/// which branch out. The returned list is always unique.
|
|
|
|
///
|
|
|
|
void getExitingBlocks(std::vector<BasicBlock*> &Blocks) const;
|
|
|
|
|
2004-04-18 22:14:10 +00:00
|
|
|
/// getExitBlocks - Return all of the successor blocks of this loop. These
|
|
|
|
/// are the blocks _outside of the current loop_ which are branched to.
|
|
|
|
///
|
|
|
|
void getExitBlocks(std::vector<BasicBlock*> &Blocks) const;
|
|
|
|
|
2006-08-29 22:29:16 +00:00
|
|
|
/// getUniqueExitBlocks - Return all unique successor blocks of this loop.
|
|
|
|
/// These are the blocks _outside of the current loop_ which are branched to.
|
|
|
|
/// This assumes that loop is in canonical form.
|
|
|
|
///
|
|
|
|
void getUniqueExitBlocks(std::vector<BasicBlock*> &ExitBlocks) const;
|
|
|
|
|
2002-09-26 05:32:43 +00:00
|
|
|
/// getLoopPreheader - If there is a preheader for this loop, return it. A
|
|
|
|
/// loop has a preheader if there is only one edge to the header of the loop
|
|
|
|
/// from outside of the loop. If this is the case, the block branching to the
|
2004-04-15 15:15:40 +00:00
|
|
|
/// header of the loop is the preheader node.
|
2002-09-26 05:32:43 +00:00
|
|
|
///
|
2004-04-15 15:15:40 +00:00
|
|
|
/// This method returns null if there is no preheader for the loop.
|
2002-09-26 05:32:43 +00:00
|
|
|
///
|
|
|
|
BasicBlock *getLoopPreheader() const;
|
|
|
|
|
2005-09-12 17:03:16 +00:00
|
|
|
/// getLoopLatch - If there is a latch block for this loop, return it. A
|
|
|
|
/// latch block is the canonical backedge for a loop. A loop header in normal
|
|
|
|
/// form has two edges into it: one from a preheader and one from a latch
|
|
|
|
/// block.
|
|
|
|
BasicBlock *getLoopLatch() const;
|
|
|
|
|
2004-04-15 15:15:40 +00:00
|
|
|
/// getCanonicalInductionVariable - Check to see if the loop has a canonical
|
|
|
|
/// induction variable: an integer recurrence that starts at 0 and increments
|
|
|
|
/// by one each time through the loop. If so, return the phi node that
|
|
|
|
/// corresponds to it.
|
|
|
|
///
|
|
|
|
PHINode *getCanonicalInductionVariable() const;
|
|
|
|
|
|
|
|
/// getCanonicalInductionVariableIncrement - Return the LLVM value that holds
|
|
|
|
/// the canonical induction variable value for the "next" iteration of the
|
|
|
|
/// loop. This always succeeds if getCanonicalInductionVariable succeeds.
|
|
|
|
///
|
|
|
|
Instruction *getCanonicalInductionVariableIncrement() const;
|
|
|
|
|
|
|
|
/// getTripCount - Return a loop-invariant LLVM value indicating the number of
|
|
|
|
/// times the loop will be executed. Note that this means that the backedge
|
|
|
|
/// of the loop executes N-1 times. If the trip-count cannot be determined,
|
|
|
|
/// this returns null.
|
|
|
|
///
|
|
|
|
Value *getTripCount() const;
|
2006-06-11 19:22:28 +00:00
|
|
|
|
|
|
|
/// isLCSSAForm - Return true if the Loop is in LCSSA form
|
|
|
|
bool isLCSSAForm() const;
|
2004-04-15 15:15:40 +00:00
|
|
|
|
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
// APIs for updating loop information after changing the CFG
|
|
|
|
//
|
|
|
|
|
2003-02-27 00:37:22 +00:00
|
|
|
/// addBasicBlockToLoop - This method is used by other analyses to update loop
|
|
|
|
/// information. NewBB is set to be a new member of the current loop.
|
2002-09-26 05:32:43 +00:00
|
|
|
/// Because of this, it is added as a member of all parent loops, and is added
|
|
|
|
/// to the specified LoopInfo object as being in the current basic block. It
|
|
|
|
/// is not valid to replace the loop header with this method.
|
|
|
|
///
|
|
|
|
void addBasicBlockToLoop(BasicBlock *NewBB, LoopInfo &LI);
|
|
|
|
|
2004-04-12 20:26:17 +00:00
|
|
|
/// replaceChildLoopWith - This is used when splitting loops up. It replaces
|
|
|
|
/// the OldChild entry in our children list with NewChild, and updates the
|
|
|
|
/// parent pointer of OldChild to be null and the NewChild to be this loop.
|
|
|
|
/// This updates the loop depth of the new child.
|
|
|
|
void replaceChildLoopWith(Loop *OldChild, Loop *NewChild);
|
|
|
|
|
|
|
|
/// addChildLoop - Add the specified loop to be a child of this loop. This
|
|
|
|
/// updates the loop depth of the new child.
|
|
|
|
///
|
|
|
|
void addChildLoop(Loop *NewChild);
|
|
|
|
|
|
|
|
/// removeChildLoop - This removes the specified child from being a subloop of
|
|
|
|
/// this loop. The loop is not deleted, as it will presumably be inserted
|
|
|
|
/// into another loop.
|
|
|
|
Loop *removeChildLoop(iterator OldChild);
|
|
|
|
|
|
|
|
/// addBlockEntry - This adds a basic block directly to the basic block list.
|
|
|
|
/// This should only be used by transformations that create new loops. Other
|
|
|
|
/// transformations should use addBasicBlockToLoop.
|
|
|
|
void addBlockEntry(BasicBlock *BB) {
|
|
|
|
Blocks.push_back(BB);
|
|
|
|
}
|
|
|
|
|
2005-03-06 20:55:34 +00:00
|
|
|
/// moveToHeader - This method is used to move BB (which must be part of this
|
|
|
|
/// loop) to be the loop header of the loop (the block that dominates all
|
|
|
|
/// others).
|
|
|
|
void moveToHeader(BasicBlock *BB) {
|
|
|
|
if (Blocks[0] == BB) return;
|
|
|
|
for (unsigned i = 0; ; ++i) {
|
|
|
|
assert(i != Blocks.size() && "Loop does not contain BB!");
|
|
|
|
if (Blocks[i] == BB) {
|
|
|
|
Blocks[i] = Blocks[0];
|
|
|
|
Blocks[0] = BB;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-04-12 20:26:17 +00:00
|
|
|
/// removeBlockFromLoop - This removes the specified basic block from the
|
2004-04-18 22:14:10 +00:00
|
|
|
/// current loop, updating the Blocks as appropriate. This does not update
|
|
|
|
/// the mapping in the LoopInfo class.
|
2004-04-12 20:26:17 +00:00
|
|
|
void removeBlockFromLoop(BasicBlock *BB);
|
|
|
|
|
2003-08-16 20:57:16 +00:00
|
|
|
void print(std::ostream &O, unsigned Depth = 0) const;
|
2006-12-17 05:15:13 +00:00
|
|
|
void print(std::ostream *O, unsigned Depth = 0) const {
|
|
|
|
if (O) print(*O, Depth);
|
|
|
|
}
|
2003-02-28 16:54:37 +00:00
|
|
|
void dump() const;
|
2001-11-26 18:41:20 +00:00
|
|
|
private:
|
|
|
|
friend class LoopInfo;
|
2004-04-12 20:26:17 +00:00
|
|
|
Loop(BasicBlock *BB) : ParentLoop(0) {
|
2004-04-19 03:03:19 +00:00
|
|
|
Blocks.push_back(BB);
|
2001-11-26 18:41:20 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
2002-09-26 05:32:43 +00:00
|
|
|
/// LoopInfo - This class builds and contains all of the top level loop
|
|
|
|
/// structures in the specified function.
|
|
|
|
///
|
2002-04-27 06:56:12 +00:00
|
|
|
class LoopInfo : public FunctionPass {
|
2001-11-26 18:41:20 +00:00
|
|
|
// BBMap - Mapping of basic blocks to the inner most loop they occur in
|
2002-04-28 00:15:57 +00:00
|
|
|
std::map<BasicBlock*, Loop*> BBMap;
|
2002-01-20 22:54:45 +00:00
|
|
|
std::vector<Loop*> TopLevelLoops;
|
2002-09-26 05:32:43 +00:00
|
|
|
friend class Loop;
|
2001-11-26 18:41:20 +00:00
|
|
|
public:
|
2007-05-06 13:37:16 +00:00
|
|
|
static char ID; // Pass identification, replacement for typeid
|
2007-05-01 21:15:47 +00:00
|
|
|
|
|
|
|
LoopInfo() : FunctionPass((intptr_t)&ID) {}
|
2002-04-09 05:43:19 +00:00
|
|
|
~LoopInfo() { releaseMemory(); }
|
2001-11-26 18:41:20 +00:00
|
|
|
|
2004-01-08 00:09:44 +00:00
|
|
|
/// iterator/begin/end - The interface to the top-level loops in the current
|
|
|
|
/// function.
|
|
|
|
///
|
|
|
|
typedef std::vector<Loop*>::const_iterator iterator;
|
|
|
|
iterator begin() const { return TopLevelLoops.begin(); }
|
|
|
|
iterator end() const { return TopLevelLoops.end(); }
|
2001-11-26 18:41:20 +00:00
|
|
|
|
2002-09-26 05:32:43 +00:00
|
|
|
/// getLoopFor - Return the inner most loop that BB lives in. If a basic
|
|
|
|
/// block is in no loop (for example the entry node), null is returned.
|
|
|
|
///
|
2004-04-19 03:03:19 +00:00
|
|
|
Loop *getLoopFor(const BasicBlock *BB) const {
|
2005-05-15 16:13:11 +00:00
|
|
|
std::map<BasicBlock *, Loop*>::const_iterator I=
|
|
|
|
BBMap.find(const_cast<BasicBlock*>(BB));
|
2001-11-26 18:41:20 +00:00
|
|
|
return I != BBMap.end() ? I->second : 0;
|
|
|
|
}
|
2002-09-26 05:32:43 +00:00
|
|
|
|
|
|
|
/// operator[] - same as getLoopFor...
|
|
|
|
///
|
2004-04-19 03:03:19 +00:00
|
|
|
const Loop *operator[](const BasicBlock *BB) const {
|
2001-11-26 18:41:20 +00:00
|
|
|
return getLoopFor(BB);
|
|
|
|
}
|
|
|
|
|
2002-09-26 05:32:43 +00:00
|
|
|
/// getLoopDepth - Return the loop nesting level of the specified block...
|
|
|
|
///
|
2002-06-25 16:13:24 +00:00
|
|
|
unsigned getLoopDepth(const BasicBlock *BB) const {
|
2001-11-26 18:41:20 +00:00
|
|
|
const Loop *L = getLoopFor(BB);
|
|
|
|
return L ? L->getLoopDepth() : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// isLoopHeader - True if the block is a loop header node
|
2002-04-28 00:15:57 +00:00
|
|
|
bool isLoopHeader(BasicBlock *BB) const {
|
2005-06-29 17:41:25 +00:00
|
|
|
const Loop *L = getLoopFor(BB);
|
|
|
|
return L && L->getHeader() == BB;
|
2001-11-26 18:41:20 +00:00
|
|
|
}
|
|
|
|
|
2002-09-26 05:32:43 +00:00
|
|
|
/// runOnFunction - Calculate the natural loop information.
|
|
|
|
///
|
2002-06-25 16:13:24 +00:00
|
|
|
virtual bool runOnFunction(Function &F);
|
2002-01-30 23:27:55 +00:00
|
|
|
|
2002-04-09 05:43:19 +00:00
|
|
|
virtual void releaseMemory();
|
2006-12-17 05:15:13 +00:00
|
|
|
|
2004-12-07 04:03:45 +00:00
|
|
|
void print(std::ostream &O, const Module* = 0) const;
|
2006-12-17 05:15:13 +00:00
|
|
|
void print(std::ostream *O, const Module* M = 0) const {
|
|
|
|
if (O) print(*O, M);
|
|
|
|
}
|
2002-04-09 05:43:19 +00:00
|
|
|
|
2002-04-27 06:56:12 +00:00
|
|
|
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
|
|
|
|
|
2004-04-18 05:37:42 +00:00
|
|
|
/// removeLoop - This removes the specified top-level loop from this loop info
|
|
|
|
/// object. The loop is not deleted, as it will presumably be inserted into
|
|
|
|
/// another loop.
|
|
|
|
Loop *removeLoop(iterator I);
|
|
|
|
|
2004-04-12 20:26:17 +00:00
|
|
|
/// changeLoopFor - Change the top-level loop that contains BB to the
|
|
|
|
/// specified loop. This should be used by transformations that restructure
|
|
|
|
/// the loop hierarchy tree.
|
|
|
|
void changeLoopFor(BasicBlock *BB, Loop *L);
|
|
|
|
|
|
|
|
/// changeTopLevelLoop - Replace the specified loop in the top-level loops
|
|
|
|
/// list with the indicated loop.
|
|
|
|
void changeTopLevelLoop(Loop *OldLoop, Loop *NewLoop);
|
|
|
|
|
2004-04-19 03:03:19 +00:00
|
|
|
/// addTopLevelLoop - This adds the specified loop to the collection of
|
|
|
|
/// top-level loops.
|
|
|
|
void addTopLevelLoop(Loop *New) {
|
|
|
|
assert(New->getParentLoop() == 0 && "Loop already in subloop!");
|
|
|
|
TopLevelLoops.push_back(New);
|
|
|
|
}
|
|
|
|
|
2004-04-18 06:54:34 +00:00
|
|
|
/// removeBlock - This method completely removes BB from all data structures,
|
|
|
|
/// including all of the Loop objects it is nested in and our mapping from
|
|
|
|
/// BasicBlocks to loops.
|
|
|
|
void removeBlock(BasicBlock *BB);
|
|
|
|
|
2001-11-26 18:41:20 +00:00
|
|
|
private:
|
2006-01-14 20:55:09 +00:00
|
|
|
void Calculate(ETForest &EF);
|
|
|
|
Loop *ConsiderForLoop(BasicBlock *BB, ETForest &EF);
|
2003-08-16 20:57:16 +00:00
|
|
|
void MoveSiblingLoopInto(Loop *NewChild, Loop *NewParent);
|
|
|
|
void InsertLoopInto(Loop *L, Loop *Parent);
|
2001-11-26 18:41:20 +00:00
|
|
|
};
|
|
|
|
|
2002-08-26 16:45:19 +00:00
|
|
|
|
2003-02-28 03:05:15 +00:00
|
|
|
// Allow clients to walk the list of nested loops...
|
|
|
|
template <> struct GraphTraits<const Loop*> {
|
|
|
|
typedef const Loop NodeType;
|
|
|
|
typedef std::vector<Loop*>::const_iterator ChildIteratorType;
|
|
|
|
|
|
|
|
static NodeType *getEntryNode(const Loop *L) { return L; }
|
2005-04-21 20:19:05 +00:00
|
|
|
static inline ChildIteratorType child_begin(NodeType *N) {
|
2004-01-08 00:09:44 +00:00
|
|
|
return N->begin();
|
2003-02-28 03:05:15 +00:00
|
|
|
}
|
2005-04-21 20:19:05 +00:00
|
|
|
static inline ChildIteratorType child_end(NodeType *N) {
|
2004-01-08 00:09:44 +00:00
|
|
|
return N->end();
|
2003-02-28 03:05:15 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <> struct GraphTraits<Loop*> {
|
|
|
|
typedef Loop NodeType;
|
|
|
|
typedef std::vector<Loop*>::const_iterator ChildIteratorType;
|
|
|
|
|
|
|
|
static NodeType *getEntryNode(Loop *L) { return L; }
|
2005-04-21 20:19:05 +00:00
|
|
|
static inline ChildIteratorType child_begin(NodeType *N) {
|
2004-01-08 00:09:44 +00:00
|
|
|
return N->begin();
|
2003-02-28 03:05:15 +00:00
|
|
|
}
|
2005-04-21 20:19:05 +00:00
|
|
|
static inline ChildIteratorType child_end(NodeType *N) {
|
2004-01-08 00:09:44 +00:00
|
|
|
return N->end();
|
2003-02-28 03:05:15 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2003-11-11 22:41:34 +00:00
|
|
|
} // End llvm namespace
|
|
|
|
|
2006-06-07 22:00:26 +00:00
|
|
|
// Make sure that any clients of this file link in LoopInfo.cpp
|
|
|
|
FORCE_DEFINING_FILE_TO_BE_LINKED(LoopInfo)
|
|
|
|
|
2001-11-26 18:41:20 +00:00
|
|
|
#endif
|