[PATCH] D21866: [ADT] Add a new data structure for managing a priority worklist where re-insertion of entries into the worklist moves them to the end.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 29 15:56:50 PDT 2016


chandlerc created this revision.
chandlerc added a subscriber: llvm-commits.
Herald added a subscriber: mcrosier.

This is fairly similar to a SetVector, but helps in the case where in
addition to not inserting duplicates you want to adjust the sequence of
a pop-off-the-back worklist.

I'm not at all attached to the name of this data structure if others
have better suggestions, but this is one that David Majnemer brought up
in IRC discussions that seems plausible.

I've trimmed the interface down somewhat from SetVector's interface
because several things make less sense here IMO: iteration primarily.
I'd prefer to add these back as we have users that need them. My use
case doesn't even need all of what is provided here. =]

I've also included a basic unittest to make sure this functions
reasonably.

http://reviews.llvm.org/D21866

Files:
  include/llvm/ADT/PriorityWorklist.h
  unittests/ADT/CMakeLists.txt
  unittests/ADT/PriorityWorklistTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21866.62298.patch
Type: text/x-patch
Size: 10233 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160629/62bac80a/attachment.bin>


More information about the llvm-commits mailing list