From 9456dd8b819f46e2c2dd4b5a6e7f92c39708f6c4 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Fri, 3 Nov 2006 07:31:32 +0000 Subject: [PATCH] Fix comments. llvm-svn: 31414 --- llvm/include/llvm/CodeGen/SelectionDAGNodes.h | 11 ++++++++--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h index 9f56e177b886..1ed4dc43c567 100644 --- a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h @@ -809,13 +809,18 @@ public: /// operation. bool hasNUsesOfValue(unsigned NUses, unsigned Value) const; - // isOnlyUse - Return true if this node is the only use of N. + /// isOnlyUse - Return true if this node is the only use of N. + /// bool isOnlyUse(SDNode *N) const; - // isOperand - Return true if this node is an operand of N. + /// isOperand - Return true if this node is an operand of N. + /// bool isOperand(SDNode *N) const; - // isPredecessor - Return true if this node is a predecessor of N. + /// isPredecessor - Return true if this node is a predecessor of N. This node + /// is either an operand of N or it can be reached by recursively traversing + /// up the operands. + /// NOTE: this is an expensive method. Use it carefully. bool isPredecessor(SDNode *N) const; /// getNumOperands - Return the number of values used by this operation. diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index fe33ff5ed4a4..4c21eff3a6f5 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2534,7 +2534,8 @@ bool SDNode::hasNUsesOfValue(unsigned NUses, unsigned Value) const { } -// isOnlyUse - Return true if this node is the only use of N. +/// isOnlyUse - Return true if this node is the only use of N. +/// bool SDNode::isOnlyUse(SDNode *N) const { bool Seen = false; for (SDNode::use_iterator I = N->use_begin(), E = N->use_end(); I != E; ++I) { @@ -2548,7 +2549,8 @@ bool SDNode::isOnlyUse(SDNode *N) const { return Seen; } -// isOperand - Return true if this node is an operand of N. +/// isOperand - Return true if this node is an operand of N. +/// bool SDOperand::isOperand(SDNode *N) const { for (unsigned i = 0, e = N->getNumOperands(); i != e; ++i) if (*this == N->getOperand(i)) @@ -2578,7 +2580,10 @@ static void findPredecessor(SDNode *N, const SDNode *P, bool &found, } } -// isPredecessor - Return true if this node is a predecessor of N. +/// isPredecessor - Return true if this node is a predecessor of N. This node +/// is either an operand of N or it can be reached by recursively traversing +/// up the operands. +/// NOTE: this is an expensive method. Use it carefully. bool SDNode::isPredecessor(SDNode *N) const { std::set Visited; bool found = false;