2 /*===------- llvm/Config/abi-breaking.h - llvm configuration -------*- C -*-===*/
4 /* The LLVM Compiler Infrastructure */
6 /* This file is distributed under the University of Illinois Open Source */
7 /* License. See LICENSE.TXT for details. */
9 /*===----------------------------------------------------------------------===*/
11 /* This file controls the C++ ABI break introduced in LLVM public header. */
13 #ifndef LLVM_ABI_BREAKING_CHECKS_H
14 #define LLVM_ABI_BREAKING_CHECKS_H
16 /* Define to enable checks that alter the LLVM C++ ABI */
17 #define LLVM_ENABLE_ABI_BREAKING_CHECKS 1
19 /* Define to disable the link-time checking of mismatch for
20 LLVM_ENABLE_ABI_BREAKING_CHECKS */
21 #define LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING 0
22 #if !LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING
24 // ABI_BREAKING_CHECKS protection: provides link-time failure when clients build
27 // Use pragma with MSVC
28 #define LLVM_XSTR(s) LLVM_STR(s)
29 #define LLVM_STR(s) #s
30 #pragma detect_mismatch("LLVM_ENABLE_ABI_BREAKING_CHECKS", LLVM_XSTR(LLVM_ENABLE_ABI_BREAKING_CHECKS))
33 #elif defined(_WIN32) || defined(__CYGWIN__) // Win32 w/o #pragma detect_mismatch
34 // FIXME: Implement checks without weak.
35 #elif defined(__cplusplus)
37 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
38 extern int EnableABIBreakingChecks;
39 __attribute__((weak, visibility ("hidden"))) int *VerifyEnableABIBreakingChecks = &EnableABIBreakingChecks;
41 extern int DisableABIBreakingChecks;
42 __attribute__((weak, visibility ("hidden"))) int *VerifyDisableABIBreakingChecks = &DisableABIBreakingChecks;
47 #endif // LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING