[ADT] fail-fast iterators for DenseMap
authorSanjoy Das <sanjoy@playingwithpointers.com>
Mon, 2 Mar 2015 23:29:37 +0000 (23:29 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Mon, 2 Mar 2015 23:29:37 +0000 (23:29 +0000)
commit47ffd6e9937a2c76a51570881307fa1edbf2db11
treefb0fc7f16727a058144065dd48be072a0efc265b
parenta6f1fd646518a922dc0bc8329ae0e73314c0aed0
[ADT] fail-fast iterators for DenseMap

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@231035 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/DenseMap.h
include/llvm/ADT/EpochTracker.h [new file with mode: 0644]