summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2007-08-17 15:13:55 +0000
committerDavid Greene <greened@obbligato.org>2007-08-17 15:13:55 +0000
commit81db5acab08f1f00e6c2ebc18e0475a475651608 (patch)
tree640511c9e106ef3e4e614405efad30409c35abcb /llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp
parentb813556f35bc93c996643b426f118ae05e2b80df (diff)
downloadbcm5719-llvm-81db5acab08f1f00e6c2ebc18e0475a475651608.tar.gz
bcm5719-llvm-81db5acab08f1f00e6c2ebc18e0475a475651608.zip
Fix GLIBCXX_DEBUG error of comparing two singular iterators
llvm-svn: 41139
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp
index 62854f76f95..f12e285416c 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSimple.cpp
@@ -164,12 +164,14 @@ private:
NodeInfo *NI; // Node info
NIIterator NGI; // Node group iterator
NIIterator NGE; // Node group iterator end
+ bool iter_valid;
public:
// Ctor.
- NodeGroupIterator(NodeInfo *N) : NI(N) {
+ NodeGroupIterator(NodeInfo *N) : NI(N), iter_valid(false) {
// If the node is in a group then set up the group iterator. Otherwise
// the group iterators will trip first time out.
+ assert(N && "Bad node info");
if (N->isInGroup()) {
// get Group
NodeGroup *Group = NI->Group;
@@ -177,14 +179,17 @@ public:
NGE = Group->group_end();
// Prevent this node from being used (will be in members list
NI = NULL;
+ iter_valid = true;
}
}
/// next - Return the next node info, otherwise NULL.
///
NodeInfo *next() {
- // If members list
- if (NGI != NGE) return *NGI++;
+ if (iter_valid) {
+ // If members list
+ if (NGI != NGE) return *NGI++;
+ }
// Use node as the result (may be NULL)
NodeInfo *Result = NI;
// Only use once
OpenPOWER on IntegriCloud