Iterating over basic blocks in reverse in LLVM Function

Is there any way to iterate in reverse on a LLVM Function. I've checked the docs but can't seem to find any member typedef for iterating Basic blocks ( in a function ) in reverse.

Any help will be appreciated.

Thanks, Malhar

728x90

1 Answers Iterating over basic blocks in reverse in LLVM Function

I think you can call Function::getBasicBlockList() and then use .rbegin() and rend() on that list.

2 year ago