llvm.org GIT mirror llvm / 4bf393a
Workaround for PR2207, in which pred_iterator assert gets triggered due to a wee problem in Xcode 2.[45]/gcc 4.0.1. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49831 91177308-0d34-0410-b5e6-96231b3b80d8 Scott Michel 12 years ago
2 changed file(s) with 13 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
3535
3636 inline void advancePastNonPreds() {
3737 // Loop to ignore non predecessor uses (for example PHI nodes)...
38 while (!It.atEnd() && !isa(*It) && !isa(*It))
38 while (!It.atEnd()) {
39 if (isa(*It) || isa(*It))
40 break;
3941 ++It;
42 }
4043 }
4144
4245 inline PredIterator(_Ptr *bb) : It(bb->use_begin()) {
102102
103103 // If AllowIdenticalEdges is true, then we allow this edge to be considered
104104 // non-critical iff all preds come from TI's block.
105 for (; I != E; ++I)
106 if (*I != FirstPred) return true;
105 while (I != E) {
106 pred_const_iterator E1 = E;
107 if (*I != FirstPred)
108 return true;
109 // Note: leave this as is until no one ever compiles with either gcc 4.0.1
110 // or Xcode 2. This seems to work around the pred_iterator assert in PR 2207
111 E = pred_end(*I);
112 ++I;
113 }
107114 return false;
108115 }
109116