summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-03-26 19:25:01 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-03-26 19:25:01 +0000
commit784545fba0e1fcbb5e12cde76d13d91fd0972323 (patch)
treeb38cec27e9e76205003cd6e11e02982fce4cf53d /CMakeLists.txt
parent55a5cb1a4ddf86adfbc1fa8eb157dd0efb4972df (diff)
[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
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bef66ec477..be78ac26f0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -252,6 +252,9 @@ else()
option(LLVM_ENABLE_ASSERTIONS "Enable assertions" ON)
endif()
+set(LLVM_ABI_BREAKING_CHECKS "WITH_ASSERTS" CACHE STRING
+ "Enable abi-breaking checks. Can be WITH_ASSERTS, FORCE_ON or FORCE_OFF.")
+
option(LLVM_FORCE_USE_OLD_HOST_TOOLCHAIN
"Set to ON to force using an old, unsupported host toolchain." OFF)