File tree 1 file changed +6
-4
lines changed
llvm/include/llvm/Transforms/Utils
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -881,19 +881,21 @@ void SampleProfileLoaderBaseImpl<BT>::buildEdges(FunctionT &F) {
881
881
882
882
// Add predecessors for B1.
883
883
SmallPtrSet<BasicBlockT *, 16 > Visited;
884
- if (!Predecessors[B1].empty ())
884
+ auto &Preds = Predecessors[B1];
885
+ if (!Preds.empty ())
885
886
llvm_unreachable (" Found a stale predecessors list in a basic block." );
886
887
for (auto *B2 : getPredecessors (B1))
887
888
if (Visited.insert (B2).second )
888
- Predecessors[B1] .push_back (B2);
889
+ Preds .push_back (B2);
889
890
890
891
// Add successors for B1.
891
892
Visited.clear ();
892
- if (!Successors[B1].empty ())
893
+ auto &Succs = Successors[B1];
894
+ if (!Succs.empty ())
893
895
llvm_unreachable (" Found a stale successors list in a basic block." );
894
896
for (auto *B2 : getSuccessors (B1))
895
897
if (Visited.insert (B2).second )
896
- Successors[B1] .push_back (B2);
898
+ Succs .push_back (B2);
897
899
}
898
900
}
899
901
You can’t perform that action at this time.
0 commit comments