Set LLVM_ENABLE_ABI_BREAKING_CHECKS for Debug builds only

LLVM_ENABLE_ABI_BREAKING_CHECKS was disabled everywhere except for
Fuchsia. It triggered llvm::Error::assertIsChecked() in the new ORCv2
code because we're supposed to check Expected<> didn't return an error
by casting it to a bool, which we only do in Debug builds.

Since this option costs performance in Release builds and we don't want
to abort on errors (especially benign ones), it should only be enable
for Debug builds. This is also the default behavior for standalone
builds of LLVM:
https://llvm.org/docs/ProgrammersManual.html#abi-breaking-checks

Bug: b/171236524
Bug: chromium:1140854
Change-Id: If886fe9ef61d0f5392949d34a63ed3d7de7aa916
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/49908
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
diff --git a/third_party/llvm-10.0/configs/android/include/llvm/Config/abi-breaking.h b/third_party/llvm-10.0/configs/android/include/llvm/Config/abi-breaking.h
index fd32bf3..de80383 100644
--- a/third_party/llvm-10.0/configs/android/include/llvm/Config/abi-breaking.h
+++ b/third_party/llvm-10.0/configs/android/include/llvm/Config/abi-breaking.h
@@ -13,7 +13,11 @@
 #define LLVM_ABI_BREAKING_CHECKS_H
 
 /* Define to enable checks that alter the LLVM C++ ABI */
+#if defined(NDEBUG)
 #define LLVM_ENABLE_ABI_BREAKING_CHECKS 0
+#else
+#define LLVM_ENABLE_ABI_BREAKING_CHECKS 1
+#endif
 
 /* Define to enable reverse iteration of unordered llvm containers */
 #define LLVM_ENABLE_REVERSE_ITERATION 0
diff --git a/third_party/llvm-10.0/configs/darwin/include/llvm/Config/abi-breaking.h b/third_party/llvm-10.0/configs/darwin/include/llvm/Config/abi-breaking.h
index fd32bf3..de80383 100644
--- a/third_party/llvm-10.0/configs/darwin/include/llvm/Config/abi-breaking.h
+++ b/third_party/llvm-10.0/configs/darwin/include/llvm/Config/abi-breaking.h
@@ -13,7 +13,11 @@
 #define LLVM_ABI_BREAKING_CHECKS_H
 
 /* Define to enable checks that alter the LLVM C++ ABI */
+#if defined(NDEBUG)
 #define LLVM_ENABLE_ABI_BREAKING_CHECKS 0
+#else
+#define LLVM_ENABLE_ABI_BREAKING_CHECKS 1
+#endif
 
 /* Define to enable reverse iteration of unordered llvm containers */
 #define LLVM_ENABLE_REVERSE_ITERATION 0
diff --git a/third_party/llvm-10.0/configs/fuchsia/include/llvm/Config/abi-breaking.h b/third_party/llvm-10.0/configs/fuchsia/include/llvm/Config/abi-breaking.h
index e3ed314..de80383 100644
--- a/third_party/llvm-10.0/configs/fuchsia/include/llvm/Config/abi-breaking.h
+++ b/third_party/llvm-10.0/configs/fuchsia/include/llvm/Config/abi-breaking.h
@@ -13,7 +13,11 @@
 #define LLVM_ABI_BREAKING_CHECKS_H
 
 /* Define to enable checks that alter the LLVM C++ ABI */
+#if defined(NDEBUG)
+#define LLVM_ENABLE_ABI_BREAKING_CHECKS 0
+#else
 #define LLVM_ENABLE_ABI_BREAKING_CHECKS 1
+#endif
 
 /* Define to enable reverse iteration of unordered llvm containers */
 #define LLVM_ENABLE_REVERSE_ITERATION 0
diff --git a/third_party/llvm-10.0/configs/linux/include/llvm/Config/abi-breaking.h b/third_party/llvm-10.0/configs/linux/include/llvm/Config/abi-breaking.h
index fd32bf3..de80383 100644
--- a/third_party/llvm-10.0/configs/linux/include/llvm/Config/abi-breaking.h
+++ b/third_party/llvm-10.0/configs/linux/include/llvm/Config/abi-breaking.h
@@ -13,7 +13,11 @@
 #define LLVM_ABI_BREAKING_CHECKS_H
 
 /* Define to enable checks that alter the LLVM C++ ABI */
+#if defined(NDEBUG)
 #define LLVM_ENABLE_ABI_BREAKING_CHECKS 0
+#else
+#define LLVM_ENABLE_ABI_BREAKING_CHECKS 1
+#endif
 
 /* Define to enable reverse iteration of unordered llvm containers */
 #define LLVM_ENABLE_REVERSE_ITERATION 0
diff --git a/third_party/llvm-10.0/configs/windows/include/llvm/Config/abi-breaking.h b/third_party/llvm-10.0/configs/windows/include/llvm/Config/abi-breaking.h
index fd32bf3..de80383 100644
--- a/third_party/llvm-10.0/configs/windows/include/llvm/Config/abi-breaking.h
+++ b/third_party/llvm-10.0/configs/windows/include/llvm/Config/abi-breaking.h
@@ -13,7 +13,11 @@
 #define LLVM_ABI_BREAKING_CHECKS_H
 
 /* Define to enable checks that alter the LLVM C++ ABI */
+#if defined(NDEBUG)
 #define LLVM_ENABLE_ABI_BREAKING_CHECKS 0
+#else
+#define LLVM_ENABLE_ABI_BREAKING_CHECKS 1
+#endif
 
 /* Define to enable reverse iteration of unordered llvm containers */
 #define LLVM_ENABLE_REVERSE_ITERATION 0
diff --git a/third_party/llvm-subzero/build/Android/include/llvm/Config/abi-breaking.h b/third_party/llvm-subzero/build/Android/include/llvm/Config/abi-breaking.h
index 627d55d..850d0c6 100644
--- a/third_party/llvm-subzero/build/Android/include/llvm/Config/abi-breaking.h
+++ b/third_party/llvm-subzero/build/Android/include/llvm/Config/abi-breaking.h
@@ -13,7 +13,11 @@
 #define LLVM_ABI_BREAKING_CHECKS_H
 
 /* Define to enable checks that alter the LLVM C++ ABI */
+#if defined(NDEBUG)
+#define LLVM_ENABLE_ABI_BREAKING_CHECKS 0
+#else
 #define LLVM_ENABLE_ABI_BREAKING_CHECKS 1
+#endif
 
 /* Define to disable the link-time checking of mismatch for
    LLVM_ENABLE_ABI_BREAKING_CHECKS */
diff --git a/third_party/llvm-subzero/build/Fuchsia/include/llvm/Config/abi-breaking.h b/third_party/llvm-subzero/build/Fuchsia/include/llvm/Config/abi-breaking.h
index 627d55d..850d0c6 100644
--- a/third_party/llvm-subzero/build/Fuchsia/include/llvm/Config/abi-breaking.h
+++ b/third_party/llvm-subzero/build/Fuchsia/include/llvm/Config/abi-breaking.h
@@ -13,7 +13,11 @@
 #define LLVM_ABI_BREAKING_CHECKS_H
 
 /* Define to enable checks that alter the LLVM C++ ABI */
+#if defined(NDEBUG)
+#define LLVM_ENABLE_ABI_BREAKING_CHECKS 0
+#else
 #define LLVM_ENABLE_ABI_BREAKING_CHECKS 1
+#endif
 
 /* Define to disable the link-time checking of mismatch for
    LLVM_ENABLE_ABI_BREAKING_CHECKS */
diff --git a/third_party/llvm-subzero/build/Linux/include/llvm/Config/abi-breaking.h b/third_party/llvm-subzero/build/Linux/include/llvm/Config/abi-breaking.h
index 627d55d..850d0c6 100644
--- a/third_party/llvm-subzero/build/Linux/include/llvm/Config/abi-breaking.h
+++ b/third_party/llvm-subzero/build/Linux/include/llvm/Config/abi-breaking.h
@@ -13,7 +13,11 @@
 #define LLVM_ABI_BREAKING_CHECKS_H
 
 /* Define to enable checks that alter the LLVM C++ ABI */
+#if defined(NDEBUG)
+#define LLVM_ENABLE_ABI_BREAKING_CHECKS 0
+#else
 #define LLVM_ENABLE_ABI_BREAKING_CHECKS 1
+#endif
 
 /* Define to disable the link-time checking of mismatch for
    LLVM_ENABLE_ABI_BREAKING_CHECKS */
diff --git a/third_party/llvm-subzero/build/MacOS/include/llvm/Config/abi-breaking.h b/third_party/llvm-subzero/build/MacOS/include/llvm/Config/abi-breaking.h
index 627d55d..850d0c6 100644
--- a/third_party/llvm-subzero/build/MacOS/include/llvm/Config/abi-breaking.h
+++ b/third_party/llvm-subzero/build/MacOS/include/llvm/Config/abi-breaking.h
@@ -13,7 +13,11 @@
 #define LLVM_ABI_BREAKING_CHECKS_H
 
 /* Define to enable checks that alter the LLVM C++ ABI */
+#if defined(NDEBUG)
+#define LLVM_ENABLE_ABI_BREAKING_CHECKS 0
+#else
 #define LLVM_ENABLE_ABI_BREAKING_CHECKS 1
+#endif
 
 /* Define to disable the link-time checking of mismatch for
    LLVM_ENABLE_ABI_BREAKING_CHECKS */
diff --git a/third_party/llvm-subzero/build/Windows/include/llvm/Config/abi-breaking.h b/third_party/llvm-subzero/build/Windows/include/llvm/Config/abi-breaking.h
index 7e003c0..603371f 100644
--- a/third_party/llvm-subzero/build/Windows/include/llvm/Config/abi-breaking.h
+++ b/third_party/llvm-subzero/build/Windows/include/llvm/Config/abi-breaking.h
@@ -13,7 +13,11 @@
 #define LLVM_ABI_BREAKING_CHECKS_H

 

 /* Define to enable checks that alter the LLVM C++ ABI */

+#if defined(NDEBUG)

+#define LLVM_ENABLE_ABI_BREAKING_CHECKS 0

+#else

 #define LLVM_ENABLE_ABI_BREAKING_CHECKS 1

+#endif

 

 /* Define to disable the link-time checking of mismatch for

    LLVM_ENABLE_ABI_BREAKING_CHECKS */