Index: llvm/include/llvm/IR/Function.h =================================================================== --- llvm/include/llvm/IR/Function.h +++ llvm/include/llvm/IR/Function.h @@ -64,6 +64,8 @@ // BasicBlock iterators... using iterator = BasicBlockListType::iterator; using const_iterator = BasicBlockListType::const_iterator; + using reverse_iterator = BasicBlockListType::reverse_iterator; + using const_reverse_iterator = BasicBlockListType::const_reverse_iterator; using arg_iterator = Argument *; using const_arg_iterator = const Argument *; @@ -766,6 +768,10 @@ const_iterator begin() const { return BasicBlocks.begin(); } iterator end () { return BasicBlocks.end(); } const_iterator end () const { return BasicBlocks.end(); } + reverse_iterator rbegin() { return BasicBlocks.rbegin();} + const_reverse_iterator rbegin() const { return BasicBlocks.rbegin();} + reverse_iterator rend() { return BasicBlocks.rend(); } + const_reverse_iterator rend() const { return BasicBlocks.rend(); } size_t size() const { return BasicBlocks.size(); } bool empty() const { return BasicBlocks.empty(); }