llvm.org GIT mirror llvm / 4442464
rename pred_const_iterator to const_pred_iterator for consistency's sake git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99567 91177308-0d34-0410-b5e6-96231b3b80d8 Gabor Greif 10 years ago
7 changed file(s) with 22 addition(s) and 22 deletion(s). Raw diff Collapse all Expand all
6666
6767 typedef PredIterator pred_iterator;
6868 typedef PredIterator
69 Value::const_use_iterator> pred_const_iterator;
69 Value::const_use_iterator> const_pred_iterator;
7070
7171 inline pred_iterator pred_begin(BasicBlock *BB) { return pred_iterator(BB); }
72 inline pred_const_iterator pred_begin(const BasicBlock *BB) {
73 return pred_const_iterator(BB);
72 inline const_pred_iterator pred_begin(const BasicBlock *BB) {
73 return const_pred_iterator(BB);
7474 }
7575 inline pred_iterator pred_end(BasicBlock *BB) { return pred_iterator(BB, true);}
76 inline pred_const_iterator pred_end(const BasicBlock *BB) {
77 return pred_const_iterator(BB, true);
76 inline const_pred_iterator pred_end(const BasicBlock *BB) {
77 return const_pred_iterator(BB, true);
7878 }
7979
8080
267267
268268 template <> struct GraphTraits > {
269269 typedef const BasicBlock NodeType;
270 typedef pred_const_iterator ChildIteratorType;
270 typedef const_pred_iterator ChildIteratorType;
271271 static NodeType *getEntryNode(Inverse G) {
272272 return G.Graph;
273273 }
397397 for (Function::const_iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI) {
398398 const BasicBlock *BB = &(*FI);
399399 BlockInformation[&F][BB] = 0;
400 pred_const_iterator predi = pred_begin(BB), prede = pred_end(BB);
400 const_pred_iterator predi = pred_begin(BB), prede = pred_end(BB);
401401 if (predi == prede) {
402402 Edge e = getEdge(0,BB);
403403 setEdgeWeight(e,0);
6666
6767 double Count = MissingValue;
6868
69 pred_const_iterator PI = pred_begin(BB), PE = pred_end(BB);
69 const_pred_iterator PI = pred_begin(BB), PE = pred_end(BB);
7070
7171 // Are there zero predecessors of this block?
7272 if (PI == PE) {
507507 // have no value
508508 double incount = 0;
509509 SmallSet pred_visited;
510 pred_const_iterator bbi = pred_begin(BB), bbe = pred_end(BB);
510 const_pred_iterator bbi = pred_begin(BB), bbe = pred_end(BB);
511511 if (bbi==bbe) {
512512 Edge e = getEdge(0,BB);
513513 incount += readEdgeOrRemember(e, getEdgeWeight(e) ,edgetocalc,uncalculated);
581581 double inWeight = 0;
582582 std::set inMissing;
583583 std::set ProcessedPreds;
584 pred_const_iterator bbi = pred_begin(BB), bbe = pred_end(BB);
584 const_pred_iterator bbi = pred_begin(BB), bbe = pred_end(BB);
585585 if (bbi == bbe) {
586586 readEdge(this,getEdge(0,BB),inWeight,inMissing);
587587 }
638638 // FI != FE; ++FI) {
639639 // const BasicBlock* BB = &(*FI);
640640 // {
641 // pred_const_iterator NBB = pred_begin(BB), End = pred_end(BB);
641 // const_pred_iterator NBB = pred_begin(BB), End = pred_end(BB);
642642 // if (NBB == End) {
643643 // setEdgeWeight(getEdge(0,BB),0);
644644 // }
778778 // Calculate incoming flow.
779779 double iw = 0; unsigned inmissing = 0; unsigned incount = 0; unsigned invalid = 0;
780780 std::set Processed;
781 for (pred_const_iterator NBB = pred_begin(BB), End = pred_end(BB);
781 for (const_pred_iterator NBB = pred_begin(BB), End = pred_end(BB);
782782 NBB != End; ++NBB) {
783783 if (Processed.insert(*NBB).second) {
784784 Edge e = getEdge(*NBB, BB);
868868 if (getEdgeWeight(e) == MissingValue) {
869869 double iw = 0;
870870 std::set Processed;
871 for (pred_const_iterator NBB = pred_begin(BB), End = pred_end(BB);
871 for (const_pred_iterator NBB = pred_begin(BB), End = pred_end(BB);
872872 NBB != End; ++NBB) {
873873 if (Processed.insert(*NBB).second) {
874874 Edge e = getEdge(*NBB, BB);
892892 const BasicBlock *Dest;
893893 Path P;
894894 bool BackEdgeFound = false;
895 for (pred_const_iterator NBB = pred_begin(BB), End = pred_end(BB);
895 for (const_pred_iterator NBB = pred_begin(BB), End = pred_end(BB);
896896 NBB != End; ++NBB) {
897897 Dest = GetPath(BB, *NBB, P, GetPathToDest | GetPathWithNewEdges);
898898 if (Dest == *NBB) {
934934 // Calculate incoming flow.
935935 double iw = 0;
936936 std::set Processed;
937 for (pred_const_iterator NBB = pred_begin(BB), End = pred_end(BB);
937 for (const_pred_iterator NBB = pred_begin(BB), End = pred_end(BB);
938938 NBB != End; ++NBB) {
939939 if (Processed.insert(*NBB).second) {
940940 Edge e = getEdge(*NBB, BB);
964964 while(FI != FE && !FoundPath) {
965965 const BasicBlock *BB = *FI; ++FI;
966966
967 for (pred_const_iterator NBB = pred_begin(BB), End = pred_end(BB);
967 for (const_pred_iterator NBB = pred_begin(BB), End = pred_end(BB);
968968 NBB != End; ++NBB) {
969969 Edge e = getEdge(*NBB,BB);
970970 double w = getEdgeWeight(e);
118118 bbi != bbe; ++bbi) {
119119 recurseBasicBlock(*bbi);
120120 }
121 for (pred_const_iterator bbi = pred_begin(BB), bbe = pred_end(BB);
121 for (const_pred_iterator bbi = pred_begin(BB), bbe = pred_end(BB);
122122 bbi != bbe; ++bbi) {
123123 recurseBasicBlock(*bbi);
124124 }
9595 double inWeight = 0;
9696 int inCount = 0;
9797 std::set ProcessedPreds;
98 for ( pred_const_iterator bbi = pred_begin(BB), bbe = pred_end(BB);
99 bbi != bbe; ++bbi ) {
98 for (const_pred_iterator bbi = pred_begin(BB), bbe = pred_end(BB);
99 bbi != bbe; ++bbi ) {
100100 if (ProcessedPreds.insert(*bbi).second) {
101101 typename ProfileInfoT::Edge E = PI->getEdge(*bbi,BB);
102102 double EdgeWeight = PI->getEdgeWeight(E);
241241
242242 // Read predecessors.
243243 std::set ProcessedPreds;
244 pred_const_iterator bpi = pred_begin(BB), bpe = pred_end(BB);
244 const_pred_iterator bpi = pred_begin(BB), bpe = pred_end(BB);
245245 // If there are none, check for (0,BB) edge.
246246 if (bpi == bpe) {
247247 DI.inWeight += ReadOrAssert(PI->getEdge(0,BB));
9393 if (TI->getNumSuccessors() == 1) return false;
9494
9595 const BasicBlock *Dest = TI->getSuccessor(SuccNum);
96 pred_const_iterator I = pred_begin(Dest), E = pred_end(Dest);
96 const_pred_iterator I = pred_begin(Dest), E = pred_end(Dest);
9797
9898 // If there is more than one predecessor, this is a critical edge...
9999 assert(I != E && "No preds, but we have an edge to the block?");
16801680 // Output predecessors for the block...
16811681 Out.PadToColumn(50);
16821682 Out << ";";
1683 pred_const_iterator PI = pred_begin(BB), PE = pred_end(BB);
1683 const_pred_iterator PI = pred_begin(BB), PE = pred_end(BB);
16841684
16851685 if (PI == PE) {
16861686 Out << " No predecessors!";