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 | 091cba1b9132759cc4ef0e9e528f244c2024c445 (patch) | |
tree | 4818d789f51cab266c17741c8de05d0980fde839 /lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | b9ee9e60a905b90fa3e84c5c6091af6e5a0382d2 (diff) |
AssignNodeIds assign each node in the DAG an unique id.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29337 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 07b7c88829..77904bf828 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/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 //===----------------------------------------------------------------------===// |