[LLVMdev] problem with llvm reverse iterator

Deepanjana Deb deepanjana.deb at gmail.com
Sat Nov 13 05:09:40 PST 2010


Hi,

I am writing an llvm pass wherein I require to iterate MachineBasicBlocks in
reverse. The ilist reverse_iterator is not functioning as expected. Nor is
the ilist iterator working
in reverse (although -- operator is overloaded to do so).

for (MachineFunction::iterator MBBI = mf_->end(), E = mf_->begin();MBBI !=
E; --MBBI)
    {
        MachineBasicBlock *MBB = MBBI;
        DEBUG(dbgs()<<*MBB<<"\n");
    }

Any suggestion would be helpful.

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101113/1d03f217/attachment.html>


More information about the llvm-dev mailing list