[llvm-commits] CVS: llvm/include/llvm/Function.h Module.h
Chris Lattner
lattner at cs.uiuc.edu
Mon Mar 14 15:50:03 PST 2005
Changes in directory llvm/include/llvm:
Function.h updated: 1.61 -> 1.62
Module.h updated: 1.58 -> 1.59
---
Log message:
Remove the reverse iterators for arguments and global vars.
Rename argument iterators arg_* instead of a*
Remove global variable iterators global_* instead of g*.
Keep the old names for temporary compatibility.
Patch contributed by Gabor Greif!
---
Diffs of the changes: (+89 -40)
Function.h | 64 +++++++++++++++++++++++++++++++++++++++++-------------------
Module.h | 65 ++++++++++++++++++++++++++++++++++++++++++-------------------
2 files changed, 89 insertions(+), 40 deletions(-)
Index: llvm/include/llvm/Function.h
diff -u llvm/include/llvm/Function.h:1.61 llvm/include/llvm/Function.h:1.62
--- llvm/include/llvm/Function.h:1.61 Sat Mar 5 13:51:20 2005
+++ llvm/include/llvm/Function.h Mon Mar 14 17:49:40 2005
@@ -57,10 +57,14 @@
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
- typedef ArgumentListType::iterator aiterator;
- typedef ArgumentListType::const_iterator const_aiterator;
- typedef std::reverse_iterator<const_aiterator> const_reverse_aiterator;
- typedef std::reverse_iterator<aiterator> reverse_aiterator;
+ typedef ArgumentListType::iterator arg_iterator;
+ typedef ArgumentListType::const_iterator const_arg_iterator;
+ typedef std::reverse_iterator<const_arg_iterator> const_reverse_arg_iterator;
+ typedef std::reverse_iterator<arg_iterator> reverse_arg_iterator;
+ typedef arg_iterator aiterator; // legacy, deprecated
+ typedef const_arg_iterator const_aiterator; // legacy, deprecated
+ typedef const_reverse_arg_iterator const_reverse_aiterator; // legacy, deprecated
+ typedef reverse_arg_iterator reverse_aiterator; // legacy, deprecated
private:
// Important things that make up a function!
@@ -187,22 +191,42 @@
//===--------------------------------------------------------------------===//
// Argument iterator forwarding functions
//
- aiterator abegin() { return ArgumentList.begin(); }
- const_aiterator abegin() const { return ArgumentList.begin(); }
- aiterator aend () { return ArgumentList.end(); }
- const_aiterator aend () const { return ArgumentList.end(); }
-
- reverse_aiterator arbegin() { return ArgumentList.rbegin(); }
- const_reverse_aiterator arbegin() const { return ArgumentList.rbegin(); }
- reverse_aiterator arend () { return ArgumentList.rend(); }
- const_reverse_aiterator arend () const { return ArgumentList.rend(); }
-
- size_t asize() const { return ArgumentList.size(); }
- bool aempty() const { return ArgumentList.empty(); }
- const Argument &afront() const { return ArgumentList.front(); }
- Argument &afront() { return ArgumentList.front(); }
- const Argument &aback() const { return ArgumentList.back(); }
- Argument &aback() { return ArgumentList.back(); }
+ arg_iterator arg_begin() { return ArgumentList.begin(); }
+ const_arg_iterator arg_begin() const { return ArgumentList.begin(); }
+ arg_iterator arg_end () { return ArgumentList.end(); }
+ const_arg_iterator arg_end () const { return ArgumentList.end(); }
+
+ reverse_arg_iterator arg_rbegin() { return ArgumentList.rbegin(); }
+ const_reverse_arg_iterator arg_rbegin() const { return ArgumentList.rbegin(); }
+ reverse_arg_iterator arg_rend () { return ArgumentList.rend(); }
+ const_reverse_arg_iterator arg_rend () const { return ArgumentList.rend(); }
+
+ size_t arg_size () const { return ArgumentList.size(); }
+ bool arg_empty() const { return ArgumentList.empty(); }
+ const Argument &arg_front() const { return ArgumentList.front(); }
+ Argument &arg_front() { return ArgumentList.front(); }
+ const Argument &arg_back () const { return ArgumentList.back(); }
+ Argument &arg_back () { return ArgumentList.back(); }
+
+ //===--------------------------------------------------------------------===//
+ // Argument iterator forwarding functions (legacy, deprecated, will be removed)
+ //
+ arg_iterator abegin() { return ArgumentList.begin(); }
+ const_arg_iterator abegin() const { return ArgumentList.begin(); }
+ arg_iterator aend () { return ArgumentList.end(); }
+ const_arg_iterator aend () const { return ArgumentList.end(); }
+
+ reverse_arg_iterator arbegin() { return ArgumentList.rbegin(); }
+ const_reverse_arg_iterator arbegin() const { return ArgumentList.rbegin(); }
+ reverse_arg_iterator arend () { return ArgumentList.rend(); }
+ const_reverse_arg_iterator arend () const { return ArgumentList.rend(); }
+
+ size_t asize() const { return ArgumentList.size(); }
+ bool aempty() const { return ArgumentList.empty(); }
+ const Argument &afront() const { return ArgumentList.front(); }
+ Argument &afront() { return ArgumentList.front(); }
+ const Argument &aback() const { return ArgumentList.back(); }
+ Argument &aback() { return ArgumentList.back(); }
virtual void print(std::ostream &OS) const { print(OS, 0); }
void print(std::ostream &OS, AssemblyAnnotationWriter *AAW) const;
Index: llvm/include/llvm/Module.h
diff -u llvm/include/llvm/Module.h:1.58 llvm/include/llvm/Module.h:1.59
--- llvm/include/llvm/Module.h:1.58 Sun Feb 13 13:15:01 2005
+++ llvm/include/llvm/Module.h Mon Mar 14 17:49:40 2005
@@ -52,10 +52,14 @@
typedef SetVector<std::string> LibraryListType;
// Global Variable iterators...
- typedef GlobalListType::iterator giterator;
- typedef GlobalListType::const_iterator const_giterator;
- typedef std::reverse_iterator<giterator> reverse_giterator;
- typedef std::reverse_iterator<const_giterator> const_reverse_giterator;
+ typedef GlobalListType::iterator global_iterator;
+ typedef GlobalListType::const_iterator const_global_iterator;
+ typedef std::reverse_iterator<global_iterator> reverse_global_iterator;
+ typedef std::reverse_iterator<const_global_iterator> const_reverse_global_iterator;
+ typedef global_iterator giterator; // these are legacy, deprecated
+ typedef const_global_iterator const_giterator;
+ typedef reverse_global_iterator reverse_giterator;
+ typedef const_reverse_global_iterator const_reverse_giterator;
// Function iterators...
typedef FunctionListType::iterator iterator;
@@ -188,22 +192,43 @@
// Module iterator forwarding functions
//
// Globals list interface
- inline giterator gbegin() { return GlobalList.begin(); }
- inline const_giterator gbegin() const { return GlobalList.begin(); }
- inline giterator gend () { return GlobalList.end(); }
- inline const_giterator gend () const { return GlobalList.end(); }
-
- inline reverse_giterator grbegin() { return GlobalList.rbegin(); }
- inline const_reverse_giterator grbegin() const { return GlobalList.rbegin(); }
- inline reverse_giterator grend () { return GlobalList.rend(); }
- inline const_reverse_giterator grend () const { return GlobalList.rend(); }
-
- inline size_t gsize() const { return GlobalList.size(); }
- inline bool gempty() const { return GlobalList.empty(); }
- inline const GlobalVariable &gfront() const { return GlobalList.front(); }
- inline GlobalVariable &gfront() { return GlobalList.front(); }
- inline const GlobalVariable &gback() const { return GlobalList.back(); }
- inline GlobalVariable &gback() { return GlobalList.back(); }
+ inline global_iterator global_begin() { return GlobalList.begin(); }
+ inline const_global_iterator global_begin() const { return GlobalList.begin(); }
+ inline global_iterator global_end () { return GlobalList.end(); }
+ inline const_global_iterator global_end () const { return GlobalList.end(); }
+
+ inline reverse_global_iterator global_rbegin() { return GlobalList.rbegin(); }
+ inline const_reverse_global_iterator global_rbegin() const { return GlobalList.rbegin(); }
+ inline reverse_global_iterator global_rend () { return GlobalList.rend(); }
+ inline const_reverse_global_iterator global_rend () const { return GlobalList.rend(); }
+
+ inline size_t global_size () const { return GlobalList.size(); }
+ inline bool global_empty() const { return GlobalList.empty(); }
+ inline const GlobalVariable &global_front() const { return GlobalList.front(); }
+ inline GlobalVariable &global_front() { return GlobalList.front(); }
+ inline const GlobalVariable &global_back () const { return GlobalList.back(); }
+ inline GlobalVariable &global_back () { return GlobalList.back(); }
+
+ //===--------------------------------------------------------------------===//
+ // Module iterator forwarding functions (legacy, deprecated, will be removed)
+ //
+ // Globals list interface
+ inline global_iterator gbegin() { return GlobalList.begin(); }
+ inline const_global_iterator gbegin() const { return GlobalList.begin(); }
+ inline global_iterator gend () { return GlobalList.end(); }
+ inline const_global_iterator gend () const { return GlobalList.end(); }
+
+ inline reverse_global_iterator grbegin() { return GlobalList.rbegin(); }
+ inline const_reverse_global_iterator grbegin() const { return GlobalList.rbegin(); }
+ inline reverse_global_iterator grend () { return GlobalList.rend(); }
+ inline const_reverse_global_iterator grend () const { return GlobalList.rend(); }
+
+ inline size_t gsize() const { return GlobalList.size(); }
+ inline bool gempty() const { return GlobalList.empty(); }
+ inline const GlobalVariable &gfront() const { return GlobalList.front(); }
+ inline GlobalVariable &gfront() { return GlobalList.front(); }
+ inline const GlobalVariable &gback() const { return GlobalList.back(); }
+ inline GlobalVariable &gback() { return GlobalList.back(); }
// FunctionList interface
inline iterator begin() { return FunctionList.begin(); }
More information about the llvm-commits
mailing list