summaryrefslogtreecommitdiff
path: root/configure
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 /configure
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 'configure')
-rwxr-xr-xconfigure31
1 files changed, 31 insertions, 0 deletions
diff --git a/configure b/configure
index 5a313feb709..4ad1f21ed3b 100755
--- a/configure
+++ b/configure
@@ -1426,6 +1426,9 @@ Optional Features:
--enable-expensive-checks
Compile with expensive debug checks enabled (default
is NO)
+ --enable-abi-breaking-checks
+ Compile with abi-breaking asserts support (default
+ is with-asserts)
--enable-debug-runtime Build runtime libs with debug symbols (default is
NO)
--enable-debug-symbols Build compiler with debug symbols (default is NO if
@@ -4980,9 +4983,11 @@ fi
if test ${enableval} = "yes" ; then
DISABLE_ASSERTIONS=
+ assertions_enabled="yes"
else
DISABLE_ASSERTIONS=DISABLE_ASSERTIONS=1
+ assertions_enabled="no"
fi
# Check whether --enable-werror was given.
@@ -5023,6 +5028,32 @@ else
fi
+# Check whether --enable-abi-breaking-checks was given.
+if test "${enable_abi_breaking_checks+set}" = set; then
+ enableval=$enable_abi_breaking_checks;
+else
+ enableval="with-asserts"
+fi
+
+case "$enableval" in
+ with-asserts) if test ${assertions_enabled} = "yes" ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define LLVM_ENABLE_ABI_BREAKING_CHECKS 1
+_ACEOF
+
+ fi ;;
+ yes)
+cat >>confdefs.h <<\_ACEOF
+#define LLVM_ENABLE_ABI_BREAKING_CHECKS 1
+_ACEOF
+ ;;
+ no) ;;
+ *) { { echo "$as_me:$LINENO: error: Invalid setting for --enable-abi-breaking-checks. Use \"with-asserts\", \"yes\" or \"no\"" >&5
+echo "$as_me: error: Invalid setting for --enable-abi-breaking-checks. Use \"with-asserts\", \"yes\" or \"no\"" >&2;}
+ { (exit 1); exit 1; }; }
+esac
+
# Check whether --enable-debug-runtime was given.
if test "${enable_debug_runtime+set}" = set; then
enableval=$enable_debug_runtime;