[ADT] fail-fast iterators for DenseMap
authorSanjoy Das <sanjoy@playingwithpointers.com>
Tue, 3 Mar 2015 20:46:45 +0000 (20:46 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Tue, 3 Mar 2015 20:46:45 +0000 (20:46 +0000)
commit4b7263d855006988854036b4a4891fcf19aebe65
tree9698d3d094cd9f0134ac94af6386e02a8b63ba95
parentd885b861e627e70b6da8bcdbc3afcbbc2e287873
[ADT] fail-fast iterators for DenseMap

This patch was landed in r231035 and reverted because it was buggy.
This is fixed version of the same change.

Summary:
This patch is an attempt at making `DenseMapIterator`s "fail-fast".
Fail-fast iterators that have been invalidated due to insertion into
the host `DenseMap` deterministically trip an assert (in debug mode)
on access, instead of non-deterministically hitting memory corruption
issues.

Reviewers: dexonsmith, dberlin, ruiu, chandlerc

Reviewed By: chandlerc

Subscribers: yaron.keren, chandlerc, llvm-commits

Differential Revision: http://reviews.llvm.org/D7931

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231125 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/DenseMap.h
include/llvm/ADT/EpochTracker.h [new file with mode: 0644]