diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-07-27 06:39:06 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-07-27 06:39:06 +0000 |
commit | 29eefc164cde317976d5ec11f4a96084f14cfdba (patch) | |
tree | 14cf4f130df23728a4b6f216ccdf23fd7d366d86 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | ad4b9f58f5aa0e3ae84bec5ca2c40753d82da3fb (diff) | |
download | bcm5719-llvm-29eefc164cde317976d5ec11f4a96084f14cfdba.tar.gz bcm5719-llvm-29eefc164cde317976d5ec11f4a96084f14cfdba.zip |
AssignNodeIds assign each node in the DAG an unique id.
llvm-svn: 29337
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 12 |
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 //===----------------------------------------------------------------------===// |