[ADT][CMake][AutoConf] Fail-fast iterators for DenseMap
authorSanjoy Das <sanjoy@playingwithpointers.com>
Thu, 26 Mar 2015 19:25:01 +0000 (19:25 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Thu, 26 Mar 2015 19:25:01 +0000 (19:25 +0000)
commit784545fba0e1fcbb5e12cde76d13d91fd0972323
treeb38cec27e9e76205003cd6e11e02982fce4cf53d
parent55a5cb1a4ddf86adfbc1fa8eb157dd0efb4972df
[ADT][CMake][AutoConf] 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.

Enabling fail-fast iterators breaks the LLVM C++ ABI, so they are
predicated on `LLVM_ENABLE_ABI_BREAKING_CHECKS`.
`LLVM_ENABLE_ABI_BREAKING_CHECKS` by default flips with
`LLVM_ENABLE_ASSERTS`, but can be clamped to ON or OFF using the CMake /
autoconf build system.

Reviewers: chandlerc, dexonsmith, rnk, zturner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233310 91177308-0d34-0410-b5e6-96231b3b80d8
CMakeLists.txt
autoconf/configure.ac
cmake/modules/HandleLLVMOptions.cmake
configure
docs/CMake.rst
docs/ProgrammersManual.rst
include/llvm/ADT/DenseMap.h
include/llvm/ADT/EpochTracker.h [new file with mode: 0644]
include/llvm/Config/config.h.in
include/llvm/Config/llvm-config.h.cmake
include/llvm/Config/llvm-config.h.in