[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
This commit is contained in:
Sanjoy Das
2015-03-26 19:25:01 +00:00
parent 55a5cb1a4d
commit 784545fba0
11 changed files with 241 additions and 20 deletions

View File

@@ -417,6 +417,9 @@
/* Installation directory for documentation */
#undef LLVM_DOCSDIR
/* Define to enable checks that alter the LLVM C++ ABI */
#undef LLVM_ENABLE_ABI_BREAKING_CHECKS
/* Define if threads enabled */
#undef LLVM_ENABLE_THREADS

View File

@@ -101,4 +101,8 @@
/* Define if we link Polly to the tools */
#cmakedefine LINK_POLLY_INTO_TOOLS
/* Define if LLVM is built with asserts and checks that change the layout of
client-visible data structures. */
#cmakedefine LLVM_ENABLE_ABI_BREAKING_CHECKS
#endif

View File

@@ -98,4 +98,7 @@
/* LLVM version string */
#undef LLVM_VERSION_STRING
/* Define to enable checks that alter the LLVM C++ ABI */
#undef LLVM_ENABLE_ABI_BREAKING_CHECKS
#endif