================
@@ -551,8 +551,9 @@ void PopulateLoopsDFS<BlockT, LoopT>::insertIntoLoop(BlockT
*Block) {
// For convenience, Blocks and Subloops are inserted in postorder. Reverse
// the lists, except for the loop header, which is always at the beginning.
Subloop->reverseBlock(1);
- std::reverse(Subloop->getSubLoopsVector().begin(),
- Subloop->getSubLoopsVector().end());
+ auto &SubloopsVec = Subloop->getSubLoopsVector();
+ if (!SubloopsVec.empty())
+ std::reverse(SubloopsVec.begin(), SubloopsVec.end());
----------------
RKSimon wrote:
where did this come from?
https://github.com/llvm/llvm-project/pull/179150
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits