projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert my last series of commits related to Timer and 64-bit atomics. Not all the...
[oota-llvm.git]
/
include
/
llvm
/
Support
/
CFG.h
diff --git
a/include/llvm/Support/CFG.h
b/include/llvm/Support/CFG.h
index f8cbeb0a50f053553e320912a54cfd8df51ddce1..b0b857bf028004aa3418ff903bd1221be8222ef1 100644
(file)
--- a/
include/llvm/Support/CFG.h
+++ b/
include/llvm/Support/CFG.h
@@
-18,7
+18,7
@@
#include "llvm/ADT/GraphTraits.h"
#include "llvm/Function.h"
#include "llvm/InstrTypes.h"
#include "llvm/ADT/GraphTraits.h"
#include "llvm/Function.h"
#include "llvm/InstrTypes.h"
-#include "llvm/ADT/iterator"
+#include "llvm/ADT/iterator
.h
"
namespace llvm {
namespace llvm {
@@
-34,17
+34,14
@@
public:
typedef PredIterator<_Ptr,_USE_iterator> _Self;
typedef typename super::pointer pointer;
typedef PredIterator<_Ptr,_USE_iterator> _Self;
typedef typename super::pointer pointer;
- inline void advancePastNonPreds() {
- // Loop to ignore non predecessor uses (for example PHI nodes)...
- while (!It.atEnd()) {
- if (isa<TerminatorInst>(*It) || isa<BasicBlock>(*It))
- break;
+ inline void advancePastNonTerminators() {
+ // Loop to ignore non terminator uses (for example PHI nodes)...
+ while (!It.atEnd() && !isa<TerminatorInst>(*It))
++It;
++It;
- }
}
inline PredIterator(_Ptr *bb) : It(bb->use_begin()) {
}
inline PredIterator(_Ptr *bb) : It(bb->use_begin()) {
- advancePastNon
Pred
s();
+ advancePastNon
Terminator
s();
}
inline PredIterator(_Ptr *bb, bool) : It(bb->use_end()) {}
}
inline PredIterator(_Ptr *bb, bool) : It(bb->use_end()) {}
@@
-53,16
+50,13
@@
public:
inline pointer operator*() const {
assert(!It.atEnd() && "pred_iterator out of range!");
inline pointer operator*() const {
assert(!It.atEnd() && "pred_iterator out of range!");
- if (isa<TerminatorInst>(*It)) // not dyn_cast due to const-correctness
- return cast<TerminatorInst>(*It)->getParent();
-
- return cast<_Ptr>(*It);
+ return cast<TerminatorInst>(*It)->getParent();
}
inline pointer *operator->() const { return &(operator*()); }
inline _Self& operator++() { // Preincrement
assert(!It.atEnd() && "pred_iterator out of range!");
}
inline pointer *operator->() const { return &(operator*()); }
inline _Self& operator++() { // Preincrement
assert(!It.atEnd() && "pred_iterator out of range!");
- ++It; advancePastNon
Pred
s();
+ ++It; advancePastNon
Terminator
s();
return *this;
}
return *this;
}
@@
-106,8
+100,6
@@
public:
inline SuccIterator(Term_ T, bool) // end iterator
: Term(T), idx(Term->getNumSuccessors()) {
assert(T && "getTerminator returned null!");
inline SuccIterator(Term_ T, bool) // end iterator
: Term(T), idx(Term->getNumSuccessors()) {
assert(T && "getTerminator returned null!");
- if (Term->getParent()->getUnwindDest())
- ++idx;
}
inline const _Self &operator=(const _Self &I) {
}
inline const _Self &operator=(const _Self &I) {
@@
-123,12
+115,7
@@
public:
inline bool operator==(const _Self& x) const { return idx == x.idx; }
inline bool operator!=(const _Self& x) const { return !operator==(x); }
inline bool operator==(const _Self& x) const { return idx == x.idx; }
inline bool operator!=(const _Self& x) const { return !operator==(x); }
- inline pointer operator*() const {
- if (idx == Term->getNumSuccessors())
- return Term->getParent()->getUnwindDest();
-
- return Term->getSuccessor(idx);
- }
+ inline pointer operator*() const { return Term->getSuccessor(idx); }
inline pointer operator->() const { return operator*(); }
inline _Self& operator++() { ++idx; return *this; } // Preincrement
inline pointer operator->() const { return operator*(); }
inline _Self& operator++() { ++idx; return *this; } // Preincrement