[LLVMdev] Appropriate DS for implementing worklist

Stephen Checkoway s at pahtak.org
Sun Nov 3 07:54:23 PST 2013


On Nov 3, 2013, at 6:29 AM, Rekha R <rekharamapai at nitc.ac.in> wrote:

> I am writing an analysis which requires creating worklist of basic blocks. The worklist should be in FIFO order. I checked SmallVector (and similar others) and found out this is working in LIFO order when I use the functions push_back and pop_back_val to insert and delete elements in the worklist.
> 
> Can someone suggest an appropriate DS to implement my worklist. Note: I am not concerned about efficiency here.

How about a std::deque? push_back(), front(), pop_front() are what you need. They're also very efficient.

-- 
Stephen Checkoway







More information about the llvm-dev mailing list