summaryrefslogtreecommitdiff
path: root/include/llvm/CFG.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-06-11 15:04:06 +0000
committerChris Lattner <sabre@nondot.org>2001-06-11 15:04:06 +0000
commit143da691f066e24a9e5272e1cabea4c446ee8cc1 (patch)
tree022b7951ae07d807bb8b591d225c0055635d725d /include/llvm/CFG.h
parentdb0926260dae4ea1e6aa1dd90d604eb09bf865d6 (diff)
downloadllvm-143da691f066e24a9e5272e1cabea4c446ee8cc1.tar.gz
llvm-143da691f066e24a9e5272e1cabea4c446ee8cc1.tar.bz2
llvm-143da691f066e24a9e5272e1cabea4c446ee8cc1.tar.xz
Updates to support
* Changes in PHI node structure * Fix to Predecessor iterator git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CFG.h')
-rw-r--r--include/llvm/CFG.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/llvm/CFG.h b/include/llvm/CFG.h
index f57475680f..b460992108 100644
--- a/include/llvm/CFG.h
+++ b/include/llvm/CFG.h
@@ -106,7 +106,7 @@ inline df_const_iterator df_end (const BasicBlock *BB);
template <class _Ptr, class _USE_iterator> // Predecessor Iterator
class PredIterator {
- const _Ptr ThisBB;
+ const _Ptr BB;
_USE_iterator It;
public:
typedef PredIterator<_Ptr,_USE_iterator> _Self;
@@ -116,15 +116,16 @@ public:
inline void advancePastConstPool() {
// Loop to ignore constant pool references
- while (It != ThisBB->use_end() &&
- ((*It)->getValueType() != Value::InstructionVal))
+ while (It != BB->use_end() &&
+ (((*It)->getValueType() != Value::InstructionVal) ||
+ !(((Instruction*)(*It))->isTerminator())))
++It;
}
- inline PredIterator(_Ptr BB) : ThisBB(BB), It(BB->use_begin()) {
+ inline PredIterator(_Ptr bb) : BB(bb), It(bb->use_begin()) {
advancePastConstPool();
}
- inline PredIterator(_Ptr BB, bool) : ThisBB(BB), It(BB->use_end()) {}
+ inline PredIterator(_Ptr bb, bool) : BB(bb), It(bb->use_end()) {}
inline bool operator==(const _Self& x) const { return It == x.It; }
inline bool operator!=(const _Self& x) const { return !operator==(x); }