Path: blob/main/lib/clang/include/llvm/Config/abi-breaking.h
35230 views
/*===------- llvm/Config/abi-breaking.h - llvm configuration -------*- C -*-===*/1/* */2/* Part of the LLVM Project, under the Apache License v2.0 with LLVM */3/* Exceptions. */4/* See https://llvm.org/LICENSE.txt for license information. */5/* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */6/* */7/*===----------------------------------------------------------------------===*/89/* This file controls the C++ ABI break introduced in LLVM public header. */1011#ifndef LLVM_ABI_BREAKING_CHECKS_H12#define LLVM_ABI_BREAKING_CHECKS_H1314/* Define to enable checks that alter the LLVM C++ ABI */15#ifdef NDEBUG16#define LLVM_ENABLE_ABI_BREAKING_CHECKS 017#else18#define LLVM_ENABLE_ABI_BREAKING_CHECKS 119#endif2021/* Define to enable reverse iteration of unordered llvm containers */22#define LLVM_ENABLE_REVERSE_ITERATION 02324/* Allow selectively disabling link-time mismatch checking so that header-only25ADT content from LLVM can be used without linking libSupport. */26#if !defined(LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING) || !LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING2728// ABI_BREAKING_CHECKS protection: provides link-time failure when clients build29// mismatch with LLVM30#if defined(_MSC_VER)31// Use pragma with MSVC32#define LLVM_XSTR(s) LLVM_STR(s)33#define LLVM_STR(s) #s34#pragma detect_mismatch("LLVM_ENABLE_ABI_BREAKING_CHECKS", LLVM_XSTR(LLVM_ENABLE_ABI_BREAKING_CHECKS))35#undef LLVM_XSTR36#undef LLVM_STR37#elif defined(_WIN32) || defined(__CYGWIN__) // Win32 w/o #pragma detect_mismatch38// FIXME: Implement checks without weak.39#elif defined(__cplusplus)40#if !(defined(_AIX) && defined(__GNUC__) && !defined(__clang__))41#define LLVM_HIDDEN_VISIBILITY __attribute__ ((visibility("hidden")))42#else43// GCC on AIX does not support visibility attributes. Symbols are not44// exported by default on AIX.45#define LLVM_HIDDEN_VISIBILITY46#endif47namespace llvm {48#if LLVM_ENABLE_ABI_BREAKING_CHECKS49extern int EnableABIBreakingChecks;50LLVM_HIDDEN_VISIBILITY51__attribute__((weak)) int *VerifyEnableABIBreakingChecks =52&EnableABIBreakingChecks;53#else54extern int DisableABIBreakingChecks;55LLVM_HIDDEN_VISIBILITY56__attribute__((weak)) int *VerifyDisableABIBreakingChecks =57&DisableABIBreakingChecks;58#endif59}60#undef LLVM_HIDDEN_VISIBILITY61#endif // _MSC_VER6263#endif // LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING6465#endif666768