diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h index c92c4ef82ae78..0a5abef0e1f9e 100644 --- a/llvm/lib/Transforms/Vectorize/VPlan.h +++ b/llvm/lib/Transforms/Vectorize/VPlan.h @@ -1309,7 +1309,10 @@ class VPBasicBlock : public VPBlockBase { appendRecipe(Recipe); } - ~VPBasicBlock() override { Recipes.clear(); } + ~VPBasicBlock() override { + while (!Recipes.empty()) + Recipes.pop_back(); + } /// Instruction iterators... using iterator = RecipeListTy::iterator;