Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:39

0001 /*===------- llvm/Config/abi-breaking.h - llvm configuration -------*- C -*-===*/
0002 /*                                                                            */
0003 /* Part of the LLVM Project, under the Apache License v2.0 with LLVM          */
0004 /* Exceptions.                                                                */
0005 /* See https://llvm.org/LICENSE.txt for license information.                  */
0006 /* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception                    */
0007 /*                                                                            */
0008 /*===----------------------------------------------------------------------===*/
0009 
0010 /* This file controls the C++ ABI break introduced in LLVM public header. */
0011 
0012 #ifndef LLVM_ABI_BREAKING_CHECKS_H
0013 #define LLVM_ABI_BREAKING_CHECKS_H
0014 
0015 /* Define to enable checks that alter the LLVM C++ ABI */
0016 #define LLVM_ENABLE_ABI_BREAKING_CHECKS 0
0017 
0018 /* Define to enable reverse iteration of unordered llvm containers */
0019 #define LLVM_ENABLE_REVERSE_ITERATION 0
0020 
0021 /* Allow selectively disabling link-time mismatch checking so that header-only
0022    ADT content from LLVM can be used without linking libSupport. */
0023 #if !defined(LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING) || !LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING
0024 
0025 // ABI_BREAKING_CHECKS protection: provides link-time failure when clients build
0026 // mismatch with LLVM
0027 #if defined(_MSC_VER)
0028 // Use pragma with MSVC
0029 #define LLVM_XSTR(s) LLVM_STR(s)
0030 #define LLVM_STR(s) #s
0031 #pragma detect_mismatch("LLVM_ENABLE_ABI_BREAKING_CHECKS", LLVM_XSTR(LLVM_ENABLE_ABI_BREAKING_CHECKS))
0032 #undef LLVM_XSTR
0033 #undef LLVM_STR
0034 #elif defined(_WIN32) || defined(__CYGWIN__) // Win32 w/o #pragma detect_mismatch
0035 // FIXME: Implement checks without weak.
0036 #elif defined(__cplusplus)
0037 #if !(defined(_AIX) && defined(__GNUC__) && !defined(__clang__))
0038 #define LLVM_HIDDEN_VISIBILITY __attribute__ ((visibility("hidden")))
0039 #else
0040 // GCC on AIX does not support visibility attributes. Symbols are not
0041 // exported by default on AIX.
0042 #define LLVM_HIDDEN_VISIBILITY
0043 #endif
0044 namespace llvm {
0045 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
0046 extern int EnableABIBreakingChecks;
0047 LLVM_HIDDEN_VISIBILITY
0048 __attribute__((weak)) int *VerifyEnableABIBreakingChecks =
0049     &EnableABIBreakingChecks;
0050 #else
0051 extern int DisableABIBreakingChecks;
0052 LLVM_HIDDEN_VISIBILITY
0053 __attribute__((weak)) int *VerifyDisableABIBreakingChecks =
0054     &DisableABIBreakingChecks;
0055 #endif
0056 }
0057 #undef LLVM_HIDDEN_VISIBILITY
0058 #endif // _MSC_VER
0059 
0060 #endif // LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING
0061 
0062 #endif