Skip to content

Commit

Permalink
fix: resolve confusing naming of priority queue
Browse files Browse the repository at this point in the history
  • Loading branch information
qasimy123 committed May 2, 2022
1 parent c3c33d2 commit 8bbc823
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions compiler/optimizer/abstractinterpreter/IDT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,20 +146,20 @@ TR::IDTNode *TR::IDT::getNodeByGlobalIndex(int32_t index)
return _indices[index + 1];
}

TR::IDTPreorderPriorityQueue::IDTPreorderPriorityQueue(TR::IDT* idt, TR::Region& region) :
TR::IDTPriorityQueue::IDTPriorityQueue(TR::IDT* idt, TR::Region& region) :
_entries(region),
_idt(idt),
_pQueue(IDTNodeCompare(), IDTNodeVector(region))
{
_pQueue.push(idt->getRoot());
}

TR::IDTNode* TR::IDTPreorderPriorityQueue::get(uint32_t index)
TR::IDTNode* TR::IDTPriorityQueue::get(uint32_t index)
{
const size_t entriesSize = _entries.size();

const uint32_t idtSize = size();
TR_ASSERT_FATAL(index < idtSize, "IDTPreorderPriorityQueue::get index out of bound!");
TR_ASSERT_FATAL(index < idtSize, "IDTPriorityQueue::get index out of bound!");
// already in entries
if (entriesSize > index)
return _entries.at(index);
Expand Down
4 changes: 2 additions & 2 deletions compiler/optimizer/abstractinterpreter/IDT.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ class IDT
* The node has the larger cost will have the higher priority
* The queue breaks the tie by comparing the benefit
*/
class IDTPreorderPriorityQueue
class IDTPriorityQueue
{
public:
IDTPreorderPriorityQueue(TR::IDT* idt, TR::Region& region);
IDTPriorityQueue(TR::IDT* idt, TR::Region& region);
uint32_t size() { return _idt->getNumNodes(); }

TR::IDTNode* get(uint32_t index);
Expand Down

0 comments on commit 8bbc823

Please sign in to comment.