xref: /freebsd/contrib/llvm-project/clang/include/clang/Basic/TargetCXXABI.def (revision fe6060f10f634930ff71b7c50291ddc610da2475)
1//===--- TargetCXXABI.def - Target C++ ABI database --------------- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines the various C++ ABI kinds used on different platforms.
10// Users of this file must define the CXXABI macro to make use of this
11// information.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef CXXABI
16#error Define the CXXABI macro to handle C++ ABI kinds.
17#endif
18
19#ifndef ITANIUM_CXXABI
20#define ITANIUM_CXXABI(Name, Str) CXXABI(Name, Str)
21#endif
22
23#ifndef MICROSOFT_CXXABI
24#define MICROSOFT_CXXABI(Name, Str) CXXABI(Name, Str)
25#endif
26
27/// The generic Itanium ABI is the standard ABI of most open-source
28/// and Unix-like platforms.  It is the primary ABI targeted by
29/// many compilers, including Clang and GCC.
30///
31/// It is documented here:
32///   http://www.codesourcery.com/public/cxx-abi/
33ITANIUM_CXXABI(GenericItanium, "itanium")
34
35/// The generic ARM ABI is a modified version of the Itanium ABI
36/// proposed by ARM for use on ARM-based platforms.
37///
38/// These changes include:
39///   - the representation of member function pointers is adjusted
40///     to not conflict with the 'thumb' bit of ARM function pointers;
41///   - constructors and destructors return 'this';
42///   - guard variables are smaller;
43///   - inline functions are never key functions;
44///   - array cookies have a slightly different layout;
45///   - additional convenience functions are specified;
46///   - and more!
47///
48/// It is documented here:
49///    http://infocenter.arm.com
50///                    /help/topic/com.arm.doc.ihi0041c/IHI0041C_cppabi.pdf
51ITANIUM_CXXABI(GenericARM, "arm")
52
53/// The iOS ABI is a partial implementation of the ARM ABI.
54/// Several of the features of the ARM ABI were not fully implemented
55/// in the compilers that iOS was launched with.
56///
57/// Essentially, the iOS ABI includes the ARM changes to:
58///   - member function pointers,
59///   - guard variables,
60///   - array cookies, and
61///   - constructor/destructor signatures.
62ITANIUM_CXXABI(iOS, "ios")
63
64/// The iOS 64-bit and macOS 64-bit ARM ABI follows ARM's published 64-bit
65/// ABI more closely, but we don't guarantee to follow it perfectly.
66///
67/// It is documented here:
68///    http://infocenter.arm.com
69///                  /help/topic/com.arm.doc.ihi0059a/IHI0059A_cppabi64.pdf
70ITANIUM_CXXABI(AppleARM64, "applearm64")
71
72/// WatchOS is a modernisation of the iOS ABI, which roughly means it's
73/// the iOS64 ABI ported to 32-bits. The primary difference from iOS64 is
74/// that RTTI objects must still be unique at the moment.
75ITANIUM_CXXABI(WatchOS, "watchos")
76
77/// The generic AArch64 ABI is also a modified version of the Itanium ABI,
78/// but it has fewer divergences than the 32-bit ARM ABI.
79///
80/// The relevant changes from the generic ABI in this case are:
81///   - representation of member function pointers adjusted as in ARM.
82///   - guard variables  are smaller.
83ITANIUM_CXXABI(GenericAArch64, "aarch64")
84
85/// The generic Mips ABI is a modified version of the Itanium ABI.
86///
87/// At the moment, only change from the generic ABI in this case is:
88///   - representation of member function pointers adjusted as in ARM.
89ITANIUM_CXXABI(GenericMIPS, "mips")
90
91/// The WebAssembly ABI is a modified version of the Itanium ABI.
92///
93/// The changes from the Itanium ABI are:
94///   - representation of member function pointers is adjusted, as in ARM;
95///   - member functions are not specially aligned;
96///   - constructors and destructors return 'this', as in ARM;
97///   - guard variables are 32-bit on wasm32, as in ARM;
98///   - unused bits of guard variables are reserved, as in ARM;
99///   - inline functions are never key functions, as in ARM;
100///   - C++11 POD rules are used for tail padding, as in iOS64.
101///
102/// TODO: At present the WebAssembly ABI is not considered stable, so none
103/// of these details is necessarily final yet.
104ITANIUM_CXXABI(WebAssembly, "webassembly")
105
106/// The Fuchsia ABI is a modified version of the Itanium ABI.
107///
108/// The relevant changes from the Itanium ABI are:
109///   - constructors and destructors return 'this', as in ARM.
110ITANIUM_CXXABI(Fuchsia, "fuchsia")
111
112/// The XL ABI is the ABI used by IBM xlclang compiler and is a modified
113/// version of the Itanium ABI.
114///
115/// The relevant changes from the Itanium ABI are:
116///   - static initialization is adjusted to use sinit and sterm functions;
117ITANIUM_CXXABI(XL, "xl")
118
119/// The Microsoft ABI is the ABI used by Microsoft Visual Studio (and
120/// compatible compilers).
121///
122/// FIXME: should this be split into Win32 and Win64 variants?
123///
124/// Only scattered and incomplete official documentation exists.
125MICROSOFT_CXXABI(Microsoft, "microsoft")
126
127#undef CXXABI
128#undef ITANIUM_CXXABI
129#undef MICROSOFT_CXXABI
130