diff options
author | Andrew Trick <atrick@apple.com> | 2013-01-25 00:12:55 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2013-01-25 00:12:55 +0000 |
commit | 6d28299b9dd3503a61ddffc64fe0201816445ab3 (patch) | |
tree | 73c2dbc1aaefc14b133ec8377bcd6ad37ee206f5 /include/llvm/CodeGen | |
parent | dd4fc446b52cf9e617846c77e2c46e827f1d533e (diff) |
SchedDFS: Constify interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173398 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r-- | include/llvm/CodeGen/ScheduleDFS.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/llvm/CodeGen/ScheduleDFS.h b/include/llvm/CodeGen/ScheduleDFS.h index 1259c78b95..faabc7b3cb 100644 --- a/include/llvm/CodeGen/ScheduleDFS.h +++ b/include/llvm/CodeGen/ScheduleDFS.h @@ -120,7 +120,7 @@ public: /// \brief Get the ILP value for a DAG node. /// /// A leaf node has an ILP of 1/1. - ILPValue getILP(const SUnit *SU) { + ILPValue getILP(const SUnit *SU) const { return ILPValue(DFSData[SU->NodeNum].InstrCount, 1 + SU->getDepth()); } @@ -128,7 +128,8 @@ public: unsigned getNumSubtrees() const { return SubtreeConnectLevels.size(); } /// \brief Get the ID of the subtree the given DAG node belongs to. - unsigned getSubtreeID(const SUnit *SU) { + unsigned getSubtreeID(const SUnit *SU) const { + assert(SU->NodeNum < DFSData.size() && "New Node"); return DFSData[SU->NodeNum].SubtreeID; } @@ -136,7 +137,7 @@ public: /// /// For bottom-up trees, the connection level is the latency depth (in cycles) /// of the deepest connection to another subtree. - unsigned getSubtreeLevel(unsigned SubtreeID) { + unsigned getSubtreeLevel(unsigned SubtreeID) const { return SubtreeConnectLevels[SubtreeID]; } |