2016-11-28 23:23:53 +01:00
|
|
|
/*===------- llvm/Config/abi-breaking.h - llvm configuration -------*- C -*-===*/
|
|
|
|
/* */
|
2019-01-19 09:50:56 +01:00
|
|
|
/* Part of the LLVM Project, under the Apache License v2.0 with LLVM */
|
|
|
|
/* Exceptions. */
|
|
|
|
/* See https://llvm.org/LICENSE.txt for license information. */
|
|
|
|
/* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */
|
2016-11-28 23:23:53 +01:00
|
|
|
/* */
|
|
|
|
/*===----------------------------------------------------------------------===*/
|
|
|
|
|
|
|
|
/* This file controls the C++ ABI break introduced in LLVM public header. */
|
|
|
|
|
|
|
|
#ifndef LLVM_ABI_BREAKING_CHECKS_H
|
|
|
|
#define LLVM_ABI_BREAKING_CHECKS_H
|
|
|
|
|
|
|
|
/* Define to enable checks that alter the LLVM C++ ABI */
|
|
|
|
#cmakedefine01 LLVM_ENABLE_ABI_BREAKING_CHECKS
|
|
|
|
|
[cmake] Enable reverse iteration by default through build macro
Summary:
Reverse iteration can be turned on, by default, by setting -DLLVM_REVERSE_ITERATION:BOOL=ON during cmake.
With this enabled, we can uncover lots of cases of non-determinism in codegen by simply running our tests (without any other change).
We can then setup a buildbot which will have this turned on by default. Initially, a lot of unit tests will fail in this configuration.
Once we start fixing non-determinism issues, we can gradually make this a blocker for patches.
Reviewers: davide, dblaikie, mehdi_amini, dberlin
Reviewed By: dblaikie
Subscribers: probinson, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D33908
llvm-svn: 304757
2017-06-06 02:36:09 +02:00
|
|
|
/* Define to enable reverse iteration of unordered llvm containers */
|
|
|
|
#cmakedefine01 LLVM_ENABLE_REVERSE_ITERATION
|
|
|
|
|
2017-03-07 01:51:07 +01:00
|
|
|
/* Allow selectively disabling link-time mismatch checking so that header-only
|
|
|
|
ADT content from LLVM can be used without linking libSupport. */
|
2020-11-24 02:17:36 +01:00
|
|
|
#if !defined(LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING) || !LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING
|
2016-12-06 02:23:04 +01:00
|
|
|
|
2016-11-28 23:23:53 +01:00
|
|
|
// ABI_BREAKING_CHECKS protection: provides link-time failure when clients build
|
|
|
|
// mismatch with LLVM
|
|
|
|
#if defined(_MSC_VER)
|
|
|
|
// Use pragma with MSVC
|
|
|
|
#define LLVM_XSTR(s) LLVM_STR(s)
|
|
|
|
#define LLVM_STR(s) #s
|
|
|
|
#pragma detect_mismatch("LLVM_ENABLE_ABI_BREAKING_CHECKS", LLVM_XSTR(LLVM_ENABLE_ABI_BREAKING_CHECKS))
|
|
|
|
#undef LLVM_XSTR
|
|
|
|
#undef LLVM_STR
|
2016-11-29 18:32:58 +01:00
|
|
|
#elif defined(_WIN32) || defined(__CYGWIN__) // Win32 w/o #pragma detect_mismatch
|
|
|
|
// FIXME: Implement checks without weak.
|
2016-11-28 23:23:53 +01:00
|
|
|
#elif defined(__cplusplus)
|
2019-03-13 22:50:25 +01:00
|
|
|
#if !(defined(_AIX) && defined(__GNUC__) && !defined(__clang__))
|
|
|
|
#define LLVM_HIDDEN_VISIBILITY __attribute__ ((visibility("hidden")))
|
|
|
|
#else
|
|
|
|
// GCC on AIX does not support visibility attributes. Symbols are not
|
|
|
|
// exported by default on AIX.
|
|
|
|
#define LLVM_HIDDEN_VISIBILITY
|
|
|
|
#endif
|
2016-11-28 23:23:53 +01:00
|
|
|
namespace llvm {
|
|
|
|
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
|
|
|
|
extern int EnableABIBreakingChecks;
|
2019-03-13 22:50:25 +01:00
|
|
|
LLVM_HIDDEN_VISIBILITY
|
|
|
|
__attribute__((weak)) int *VerifyEnableABIBreakingChecks =
|
|
|
|
&EnableABIBreakingChecks;
|
2016-11-28 23:23:53 +01:00
|
|
|
#else
|
|
|
|
extern int DisableABIBreakingChecks;
|
2019-03-13 22:50:25 +01:00
|
|
|
LLVM_HIDDEN_VISIBILITY
|
|
|
|
__attribute__((weak)) int *VerifyDisableABIBreakingChecks =
|
|
|
|
&DisableABIBreakingChecks;
|
2016-11-28 23:23:53 +01:00
|
|
|
#endif
|
|
|
|
}
|
2019-03-13 22:50:25 +01:00
|
|
|
#undef LLVM_HIDDEN_VISIBILITY
|
2016-11-28 23:23:53 +01:00
|
|
|
#endif // _MSC_VER
|
|
|
|
|
2016-12-06 02:23:04 +01:00
|
|
|
#endif // LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING
|
|
|
|
|
2016-11-28 23:23:53 +01:00
|
|
|
#endif
|