summaryrefslogtreecommitdiff
path: root/include/llvm/BasicBlock.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-06-07 16:58:36 +0000
committerChris Lattner <sabre@nondot.org>2001-06-07 16:58:36 +0000
commitbbcfc51f3b2c483a8212205dbfae3b59400b306d (patch)
tree958fd67decec4388fbedac48dd590991327ac9cd /include/llvm/BasicBlock.h
parent753bfecb77f908aa45d58cab7107a2730cc38d65 (diff)
downloadllvm-bbcfc51f3b2c483a8212205dbfae3b59400b306d.tar.gz
llvm-bbcfc51f3b2c483a8212205dbfae3b59400b306d.tar.bz2
llvm-bbcfc51f3b2c483a8212205dbfae3b59400b306d.tar.xz
Fixes for BB iterators, additional methods added for DCE pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/BasicBlock.h')
-rw-r--r--include/llvm/BasicBlock.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/include/llvm/BasicBlock.h b/include/llvm/BasicBlock.h
index 6873ef2deb..5230e87d8d 100644
--- a/include/llvm/BasicBlock.h
+++ b/include/llvm/BasicBlock.h
@@ -148,7 +148,16 @@ public:
typedef bidirectional_iterator_tag iterator_category;
typedef _Ptr pointer;
- inline PredIterator(_Ptr BB) : ThisBB(BB), It(BB->use_begin()) {}
+ inline void advancePastConstPool() {
+ // Loop to ignore constant pool references
+ while (It != ThisBB->use_end() &&
+ ((*It)->getValueType() != Value::InstructionVal))
+ ++It;
+ }
+
+ inline PredIterator(_Ptr BB) : ThisBB(BB), It(BB->use_begin()) {
+ advancePastConstPool();
+ }
inline PredIterator(_Ptr BB, bool) : ThisBB(BB), It(BB->use_end()) {}
inline bool operator==(const _Self& x) const { return It == x.It; }
@@ -161,13 +170,7 @@ public:
inline pointer *operator->() const { return &(operator*()); }
inline _Self& operator++() { // Preincrement
- do { // Loop to ignore constant pool references
- ++It;
- } while (It != ThisBB->use_end() &&
- ((*It)->getValueType() != Value::ConstantVal));
-
- // DOES THIS WORK???
- //((*It)->getValueType() != Value::BasicBlockVal));
+ ++It; advancePastConstPool();
return *this;
}