Warning, /include/clang/Basic/TargetCXXABI.def is written in an unsupported language. File is not indexed.
0001 //===--- TargetCXXABI.def - Target C++ ABI database --------------- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This file defines the various C++ ABI kinds used on different platforms.
0010 // Users of this file must define the CXXABI macro to make use of this
0011 // information.
0012 //
0013 //===----------------------------------------------------------------------===//
0014
0015 #ifndef CXXABI
0016 #error Define the CXXABI macro to handle C++ ABI kinds.
0017 #endif
0018
0019 #ifndef ITANIUM_CXXABI
0020 #define ITANIUM_CXXABI(Name, Str) CXXABI(Name, Str)
0021 #endif
0022
0023 #ifndef MICROSOFT_CXXABI
0024 #define MICROSOFT_CXXABI(Name, Str) CXXABI(Name, Str)
0025 #endif
0026
0027 /// The generic Itanium ABI is the standard ABI of most open-source
0028 /// and Unix-like platforms. It is the primary ABI targeted by
0029 /// many compilers, including Clang and GCC.
0030 ///
0031 /// It is documented here:
0032 /// http://itanium-cxx-abi.github.io/cxx-abi/
0033 ITANIUM_CXXABI(GenericItanium, "itanium")
0034
0035 /// The generic ARM ABI is a modified version of the Itanium ABI
0036 /// proposed by ARM for use on ARM-based platforms.
0037 ///
0038 /// These changes include:
0039 /// - the representation of member function pointers is adjusted
0040 /// to not conflict with the 'thumb' bit of ARM function pointers;
0041 /// - constructors and destructors return 'this';
0042 /// - guard variables are smaller;
0043 /// - inline functions are never key functions;
0044 /// - array cookies have a slightly different layout;
0045 /// - additional convenience functions are specified;
0046 /// - and more!
0047 ///
0048 /// It is documented here:
0049 /// https://github.com/ARM-software/abi-aa/blob/main/cppabi32/cppabi32.rst
0050 ITANIUM_CXXABI(GenericARM, "arm")
0051
0052 /// The iOS ABI is a partial implementation of the ARM ABI.
0053 /// Several of the features of the ARM ABI were not fully implemented
0054 /// in the compilers that iOS was launched with.
0055 ///
0056 /// Essentially, the iOS ABI includes the ARM changes to:
0057 /// - member function pointers,
0058 /// - guard variables,
0059 /// - array cookies, and
0060 /// - constructor/destructor signatures.
0061 ITANIUM_CXXABI(iOS, "ios")
0062
0063 /// The iOS 64-bit and macOS 64-bit ARM ABI follows ARM's published 64-bit
0064 /// ABI more closely, but we don't guarantee to follow it perfectly.
0065 ITANIUM_CXXABI(AppleARM64, "applearm64")
0066
0067 /// WatchOS is a modernisation of the iOS ABI, which roughly means it's
0068 /// the iOS64 ABI ported to 32-bits. The primary difference from iOS64 is
0069 /// that RTTI objects must still be unique at the moment.
0070 ITANIUM_CXXABI(WatchOS, "watchos")
0071
0072 /// The generic AArch64 ABI is also a modified version of the Itanium ABI,
0073 /// but it has fewer divergences than the 32-bit ARM ABI.
0074 ///
0075 /// The relevant changes from the generic ABI in this case are:
0076 /// - representation of member function pointers adjusted as in ARM.
0077 /// - guard variables are smaller.
0078 ///
0079 /// It is documented here:
0080 /// https://github.com/ARM-software/abi-aa/blob/main/cppabi64/cppabi64.rst
0081 ITANIUM_CXXABI(GenericAArch64, "aarch64")
0082
0083 /// The generic Mips ABI is a modified version of the Itanium ABI.
0084 ///
0085 /// At the moment, only change from the generic ABI in this case is:
0086 /// - representation of member function pointers adjusted as in ARM.
0087 ITANIUM_CXXABI(GenericMIPS, "mips")
0088
0089 /// The WebAssembly ABI is a modified version of the Itanium ABI.
0090 ///
0091 /// The changes from the Itanium ABI are:
0092 /// - representation of member function pointers is adjusted, as in ARM;
0093 /// - member functions are not specially aligned;
0094 /// - constructors and destructors return 'this', as in ARM;
0095 /// - guard variables are 32-bit on wasm32, as in ARM;
0096 /// - unused bits of guard variables are reserved, as in ARM;
0097 /// - inline functions are never key functions, as in ARM;
0098 /// - C++11 POD rules are used for tail padding, as in iOS64.
0099 ///
0100 /// TODO: At present the WebAssembly ABI is not considered stable, so none
0101 /// of these details is necessarily final yet.
0102 ITANIUM_CXXABI(WebAssembly, "webassembly")
0103
0104 /// The Fuchsia ABI is a modified version of the Itanium ABI.
0105 ///
0106 /// The relevant changes from the Itanium ABI are:
0107 /// - constructors and destructors return 'this', as in ARM.
0108 ITANIUM_CXXABI(Fuchsia, "fuchsia")
0109
0110 /// The XL ABI is the ABI used by IBM xlclang compiler and is a modified
0111 /// version of the Itanium ABI.
0112 ///
0113 /// The relevant changes from the Itanium ABI are:
0114 /// - static initialization is adjusted to use sinit and sterm functions;
0115 ITANIUM_CXXABI(XL, "xl")
0116
0117 /// The Microsoft ABI is the ABI used by Microsoft Visual Studio (and
0118 /// compatible compilers).
0119 ///
0120 /// FIXME: should this be split into Win32 and Win64 variants?
0121 ///
0122 /// Only scattered and incomplete official documentation exists.
0123 MICROSOFT_CXXABI(Microsoft, "microsoft")
0124
0125 #undef CXXABI
0126 #undef ITANIUM_CXXABI
0127 #undef MICROSOFT_CXXABI