From: Duncan P. N. Exon Smith Date: Mon, 28 Jul 2014 21:09:32 +0000 (+0000) Subject: IR: Expose Module::rbegin() and rend() X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=31e6dbfd54acec83afffb12798eb389fc1c96a58;p=oota-llvm.git IR: Expose Module::rbegin() and rend() A follow-up commit for PR5680 needs to visit functions in reverse order. Expose iterators to allow that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214121 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/IR/Module.h b/include/llvm/IR/Module.h index 26f62db9db5..1fdbf5d878b 100644 --- a/include/llvm/IR/Module.h +++ b/include/llvm/IR/Module.h @@ -137,6 +137,11 @@ public: /// The Function constant iterator typedef FunctionListType::const_iterator const_iterator; + /// The Function reverse iterator. + typedef FunctionListType::reverse_iterator reverse_iterator; + /// The Function constant reverse iterator. + typedef FunctionListType::const_reverse_iterator const_reverse_iterator; + /// The Global Alias iterators. typedef AliasListType::iterator alias_iterator; /// The Global Alias constant iterator @@ -546,6 +551,10 @@ public: const_iterator begin() const { return FunctionList.begin(); } iterator end () { return FunctionList.end(); } const_iterator end () const { return FunctionList.end(); } + reverse_iterator rbegin() { return FunctionList.rbegin(); } + const_reverse_iterator rbegin() const{ return FunctionList.rbegin(); } + reverse_iterator rend() { return FunctionList.rend(); } + const_reverse_iterator rend() const { return FunctionList.rend(); } size_t size() const { return FunctionList.size(); } bool empty() const { return FunctionList.empty(); }