Start adding and cleaning up comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39894 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky
2007-07-16 02:58:37 +00:00
parent eefdebe002
commit 5380e941ef

View File

@@ -212,13 +212,19 @@ namespace {
} }
} }
/// getRootNode - This returns the entry node for the CFG of the function.
Node *getRootNode() const { return Entry; } Node *getRootNode() const { return Entry; }
/// getNodeForBlock - return the node for the specified basic block.
Node *getNodeForBlock(BasicBlock *BB) const { Node *getNodeForBlock(BasicBlock *BB) const {
if (!NodeMap.count(BB)) return 0; if (!NodeMap.count(BB)) return 0;
return const_cast<DomTreeDFS*>(this)->NodeMap[BB]; return const_cast<DomTreeDFS*>(this)->NodeMap[BB];
} }
/// dominates - returns true if the basic block for I1 dominates that of
/// the basic block for I2. If the instructions belong to the same basic
/// block, the instruction first instruction sequentially in the block is
/// considered dominating.
bool dominates(Instruction *I1, Instruction *I2) { bool dominates(Instruction *I1, Instruction *I2) {
BasicBlock *BB1 = I1->getParent(), BasicBlock *BB1 = I1->getParent(),
*BB2 = I2->getParent(); *BB2 = I2->getParent();
@@ -240,7 +246,10 @@ namespace {
return Node1 && Node2 && Node1->dominates(Node2); return Node1 && Node2 && Node1->dominates(Node2);
} }
} }
private: private:
/// renumber - calculates the depth first search numberings and applies
/// them onto the nodes.
void renumber() { void renumber() {
std::stack<std::pair<Node *, Node::iterator> > S; std::stack<std::pair<Node *, Node::iterator> > S;
unsigned n = 0; unsigned n = 0;
@@ -2234,11 +2243,11 @@ namespace {
} }
private: private:
/// Forwards - Adds new properties into PropertySet and uses them to /// Forwards - Adds new properties to VRPSolver and uses them to
/// simplify instructions. Because new properties sometimes apply to /// simplify instructions. Because new properties sometimes apply to
/// a transition from one BasicBlock to another, this will use the /// a transition from one BasicBlock to another, this will use the
/// PredicateSimplifier::proceedToSuccessor(s) interface to enter the /// PredicateSimplifier::proceedToSuccessor(s) interface to enter the
/// basic block with the new PropertySet. /// basic block.
/// @brief Performs abstract execution of the program. /// @brief Performs abstract execution of the program.
class VISIBILITY_HIDDEN Forwards : public InstVisitor<Forwards> { class VISIBILITY_HIDDEN Forwards : public InstVisitor<Forwards> {
friend class InstVisitor<Forwards>; friend class InstVisitor<Forwards>;
@@ -2294,8 +2303,7 @@ namespace {
} }
} }
// Tries to simplify each Instruction and add new properties to // Tries to simplify each Instruction and add new properties.
// the PropertySet.
void visitInstruction(Instruction *I, DomTreeDFS::Node *DT) { void visitInstruction(Instruction *I, DomTreeDFS::Node *DT) {
DOUT << "Considering instruction " << *I << "\n"; DOUT << "Considering instruction " << *I << "\n";
DEBUG(VN->dump()); DEBUG(VN->dump());