|
| 1 | +//===--- ABIVersions.def - Clang ABI Versions 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 enumerates Clang ABI versions. |
| 10 | +// |
| 11 | +//===----------------------------------------------------------------------===// |
| 12 | +// |
| 13 | +/// @file ABIVersions.def |
| 14 | +/// |
| 15 | +/// In this file, each of the Clang ABI Versions is enumerated |
| 16 | +/// ABI_VER_MAJOR_MINOR, ABI_VER_MAJOR, or ABI_VER_LATEST macro. |
| 17 | +/// |
| 18 | +/// ABI_VER_MAJOR is used when the minor version is 0 or can be omitted. |
| 19 | +/// |
| 20 | +/// The first argument of ABI_VER_MAJOR_MINOR and ABI_VER_MAJOR is the major |
| 21 | +/// version. |
| 22 | +/// |
| 23 | +/// The second argument of ABI_VER_MAJOR_MINOR is the minor version. |
| 24 | +/// |
| 25 | +/// The first argument of ABI_VER_LATEST is an identifier `Latest`. |
| 26 | + |
| 27 | +#if defined(ABI_VER_MAJOR_MINOR) != defined(ABI_VER_MAJOR) || \ |
| 28 | + defined(ABI_VER_MAJOR) != defined(ABI_VER_LATEST) |
| 29 | +# error ABI_VER_MAJOR_MINOR, ABI_VER_MAJOR and ABI_VER_LATEST should be defined simultaneously |
| 30 | +#endif |
| 31 | + |
| 32 | +#ifndef ABI_VER_MAJOR_MINOR |
| 33 | +# define ABI_VER_MAJOR_MINOR(Major, Minor) |
| 34 | +#endif |
| 35 | + |
| 36 | +#ifndef ABI_VER_MAJOR |
| 37 | +# define ABI_VER_MAJOR(Major) |
| 38 | +#endif |
| 39 | + |
| 40 | +#ifndef ABI_VER_LATEST |
| 41 | +# define ABI_VER_LATEST(Latest) |
| 42 | +#endif |
| 43 | + |
| 44 | +/// Attempt to be ABI-compatible with code generated by Clang 3.8.x |
| 45 | +/// (SVN r257626). This causes <1 x long long> to be passed in an integer |
| 46 | +/// register instead of an SSE register on x64_64. |
| 47 | +ABI_VER_MAJOR_MINOR(3, 8) |
| 48 | + |
| 49 | +/// Attempt to be ABI-compatible with code generated by Clang 4.0.x |
| 50 | +/// (SVN r291814). This causes move operations to be ignored when determining |
| 51 | +/// whether a class type can be passed or returned directly. |
| 52 | +ABI_VER_MAJOR(4) |
| 53 | + |
| 54 | +/// Attempt to be ABI-compatible with code generated by Clang 6.0.x |
| 55 | +/// (SVN r321711). This causes determination of whether a type is |
| 56 | +/// standard-layout to ignore collisions between empty base classes and between |
| 57 | +/// base classes and member subobjects, which affects whether we reuse base |
| 58 | +/// class tail padding in some ABIs. |
| 59 | +ABI_VER_MAJOR(6) |
| 60 | + |
| 61 | +/// Attempt to be ABI-compatible with code generated by Clang 7.0.x |
| 62 | +/// (SVN r338536). This causes alignof (C++) and _Alignof (C11) to be compatible |
| 63 | +/// with __alignof (i.e., return the preferred alignment) rather than returning |
| 64 | +/// the required alignment. |
| 65 | +ABI_VER_MAJOR(7) |
| 66 | + |
| 67 | +/// Attempt to be ABI-compatible with code generated by Clang 9.0.x |
| 68 | +/// (SVN r351319). This causes vectors of __int128 to be passed in memory |
| 69 | +/// instead of passing in multiple scalar registers on x86_64 on Linux and |
| 70 | +/// NetBSD. |
| 71 | +ABI_VER_MAJOR(9) |
| 72 | + |
| 73 | +/// Attempt to be ABI-compatible with code generated by Clang 11.0.x |
| 74 | +/// (git 2e10b7a39b93). This causes clang to pass unions with a 256-bit vector |
| 75 | +/// member on the stack instead of using registers, to not properly mangle |
| 76 | +/// substitutions for template names in some cases, and to mangle declaration |
| 77 | +/// template arguments without a cast to the parameter type even when that can |
| 78 | +/// lead to mangling collisions. |
| 79 | +ABI_VER_MAJOR(11) |
| 80 | + |
| 81 | +/// Attempt to be ABI-compatible with code generated by Clang 12.0.x |
| 82 | +/// (git 8e464dd76bef). This causes clang to mangle lambdas within global-scope |
| 83 | +/// inline variables incorrectly. |
| 84 | +ABI_VER_MAJOR(12) |
| 85 | + |
| 86 | +/// Attempt to be ABI-compatible with code generated by Clang 14.0.x. |
| 87 | +/// This causes clang to: |
| 88 | +/// - mangle dependent nested names incorrectly. |
| 89 | +/// - make trivial only those defaulted copy constructors with a |
| 90 | +/// parameter-type-list equivalent to the parameter-type-list of an implicit |
| 91 | +/// declaration. |
| 92 | +ABI_VER_MAJOR(14) |
| 93 | + |
| 94 | +/// Attempt to be ABI-compatible with code generated by Clang 15.0.x. |
| 95 | +/// This causes clang to: |
| 96 | +/// - Reverse the implementation for CWG692, CWG1395 and CWG1432. |
| 97 | +/// - pack non-POD members of packed structs. |
| 98 | +/// - consider classes with defaulted special member functions non-pod. |
| 99 | +ABI_VER_MAJOR(15) |
| 100 | + |
| 101 | +/// Attempt to be ABI-compatible with code generated by Clang 17.0.x. |
| 102 | +/// This causes clang to revert some fixes to its implementation of the Itanium |
| 103 | +/// name mangling scheme, with the consequence that overloaded function |
| 104 | +/// templates are mangled the same if they differ only by: |
| 105 | +/// - constraints |
| 106 | +/// - whether a non-type template parameter has a deduced type |
| 107 | +/// - the parameter list of a template template parameter |
| 108 | +ABI_VER_MAJOR(17) |
| 109 | + |
| 110 | +/// Attempt to be ABI-compatible with code generated by Clang 18.0.x. |
| 111 | +/// This causes clang to revert some fixes to the mangling of lambdas in the |
| 112 | +/// initializers of members of local classes. |
| 113 | +ABI_VER_MAJOR(18) |
| 114 | + |
| 115 | +/// Attempt to be ABI-compatible with code generated by Clang 19.0.x. |
| 116 | +/// This causes clang to: |
| 117 | +/// - Incorrectly mangle the 'base type' substitutions of the CXX construction |
| 118 | +/// vtable because it hasn't added 'type' as a substitution. |
| 119 | +/// - Skip mangling enclosing class templates of member-like friend function |
| 120 | +/// templates. |
| 121 | +/// - Ignore empty struct arguments in C++ mode for ARM, instead of passing |
| 122 | +/// them as if they had a size of 1 byte. |
| 123 | +ABI_VER_MAJOR(19) |
| 124 | + |
| 125 | +/// Attempt to be ABI-compatible with code generated by Clang 20.0.x. |
| 126 | +/// This causes clang to: |
| 127 | +/// - Incorrectly return C++ records in AVX registers on x86_64. |
| 128 | +ABI_VER_MAJOR(20) |
| 129 | + |
| 130 | +/// Conform to the underlying platform's C and C++ ABIs as closely as we can. |
| 131 | +ABI_VER_LATEST(Latest) |
| 132 | + |
| 133 | +#undef ABI_VER_MAJOR_MINOR |
| 134 | +#undef ABI_VER_MAJOR |
| 135 | +#undef ABI_VER_LATEST |
0 commit comments