Add an assertion to PlaceholderQueue destructor, ensuring it has been flushed

llvm-svn: 292597
This commit is contained in:
Mehdi Amini
2017-01-20 10:18:32 +00:00
parent 07dbde214b
commit 2737989245

View File

@@ -358,6 +358,9 @@ class PlaceholderQueue {
std::deque<DistinctMDOperandPlaceholder> PHs;
public:
~PlaceholderQueue() {
assert(empty() && "PlaceholderQueue hasn't been flushed before being destroyed");
}
bool empty() { return PHs.empty(); }
DistinctMDOperandPlaceholder &getPlaceholderOp(unsigned ID);
void flush(BitcodeReaderMetadataList &MetadataList);