summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-07-27 06:39:06 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-07-27 06:39:06 +0000
commit29eefc164cde317976d5ec11f4a96084f14cfdba (patch)
tree14cf4f130df23728a4b6f216ccdf23fd7d366d86
parentad4b9f58f5aa0e3ae84bec5ca2c40753d82da3fb (diff)
downloadbcm5719-llvm-29eefc164cde317976d5ec11f4a96084f14cfdba.tar.gz
bcm5719-llvm-29eefc164cde317976d5ec11f4a96084f14cfdba.zip
AssignNodeIds assign each node in the DAG an unique id.
llvm-svn: 29337
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 07b7c88829e..77904bf8287 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -2698,6 +2698,18 @@ void SelectionDAG::ReplaceAllUsesOfValueWith(SDOperand From, SDOperand To,
}
+/// AssignNodeIds - Assign a unique node id for each node in the DAG. It returns
+/// the maximum id.
+int SelectionDAG::AssignNodeIds() {
+ int Id = 0;
+ for (allnodes_iterator I = allnodes_begin(), E = allnodes_end(); I != E; ++I){
+ SDNode *N = I;
+ N->setNodeId(Id++);
+ }
+ return Id;
+}
+
+
//===----------------------------------------------------------------------===//
// SDNode Class
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud