diff options
author | Will Dietz <wdietz2@illinois.edu> | 2013-10-16 04:10:06 +0000 |
---|---|---|
committer | Will Dietz <wdietz2@illinois.edu> | 2013-10-16 04:10:06 +0000 |
commit | 1e6810005f426798ce2541c26f0cdc7a08670846 (patch) | |
tree | 79486fbc96f975a10d7dad4155cdf9967bc30902 /include | |
parent | 86df596c4121633114fca22585583f7b585b87aa (diff) | |
download | external_llvm-1e6810005f426798ce2541c26f0cdc7a08670846.zip external_llvm-1e6810005f426798ce2541c26f0cdc7a08670846.tar.gz external_llvm-1e6810005f426798ce2541c26f0cdc7a08670846.tar.bz2 |
TypeFinder: prefer iterative algorithm to keep stack usage low.
Introduce subtype_reverse_iterator to maintain
the numbering assigned during the recursive type walk.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192770 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/IR/Type.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/IR/Type.h b/include/llvm/IR/Type.h index 1bf8789..3cfb84e 100644 --- a/include/llvm/IR/Type.h +++ b/include/llvm/IR/Type.h @@ -324,6 +324,14 @@ public: subtype_iterator subtype_begin() const { return ContainedTys; } subtype_iterator subtype_end() const { return &ContainedTys[NumContainedTys];} + typedef std::reverse_iterator<subtype_iterator> subtype_reverse_iterator; + subtype_reverse_iterator subtype_rbegin() const { + return subtype_reverse_iterator(subtype_end()); + } + subtype_reverse_iterator subtype_rend() const { + return subtype_reverse_iterator(subtype_begin()); + } + /// getContainedType - This method is used to implement the type iterator /// (defined a the end of the file). For derived types, this returns the /// types 'contained' in the derived type. |