[VPlan] Assert no users remaining when deleting a VPValue.

When deleting a VPValue, all users must already by deleted. Add an
assertion to make sure and catch violations.
This commit is contained in:
Florian Hahn 2020-10-03 21:05:39 +01:00
parent 44c1a56869
commit ca38652b9a
1 changed files with 4 additions and 0 deletions

View File

@ -84,6 +84,10 @@ public:
VPValue(const VPValue &) = delete;
VPValue &operator=(const VPValue &) = delete;
virtual ~VPValue() {
assert(Users.empty() && "trying to delete a VPValue with remaining users");
}
/// \return an ID for the concrete type of this object.
/// This is used to implement the classof checks. This should not be used
/// for any other purpose, as the values may change as LLVM evolves.