-
Notifications
You must be signed in to change notification settings - Fork 14.7k
[Clang][NFC] Enumerate Clang ABI versions in a separate header file #151995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
//===--- ABIVersions.def - Clang ABI Versions Database ----------*- C++ -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This file enumerates Clang ABI versions. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
/// @file ABIVersions.def | ||
/// | ||
/// In this file, each of the Clang ABI Versions is enumerated | ||
/// ABI_VER_MAJOR_MINOR, ABI_VER_MAJOR, or ABI_VER_LATEST macro. | ||
/// | ||
/// ABI_VER_MAJOR is used when the minor version is 0 or can be omitted. | ||
/// | ||
/// The first argument of ABI_VER_MAJOR_MINOR and ABI_VER_MAJOR is the major | ||
/// version. | ||
/// | ||
/// The second argument of ABI_VER_MAJOR_MINOR is the minor version. | ||
/// | ||
/// The first argument of ABI_VER_LATEST is an identifier `Latest`. | ||
|
||
#if defined(ABI_VER_MAJOR_MINOR) != defined(ABI_VER_MAJOR) || \ | ||
defined(ABI_VER_MAJOR) != defined(ABI_VER_LATEST) | ||
# error ABI_VER_MAJOR_MINOR, ABI_VER_MAJOR and ABI_VER_LATEST should be defined simultaneously | ||
#endif | ||
|
||
#ifndef ABI_VER_MAJOR_MINOR | ||
# define ABI_VER_MAJOR_MINOR(Major, Minor) | ||
#endif | ||
|
||
#ifndef ABI_VER_MAJOR | ||
# define ABI_VER_MAJOR(Major) | ||
#endif | ||
|
||
#ifndef ABI_VER_LATEST | ||
# define ABI_VER_LATEST(Latest) | ||
#endif | ||
|
||
/// Attempt to be ABI-compatible with code generated by Clang 3.8.x | ||
/// (SVN r257626). This causes <1 x long long> to be passed in an integer | ||
/// register instead of an SSE register on x64_64. | ||
ABI_VER_MAJOR_MINOR(3, 8) | ||
|
||
/// Attempt to be ABI-compatible with code generated by Clang 4.0.x | ||
/// (SVN r291814). This causes move operations to be ignored when determining | ||
/// whether a class type can be passed or returned directly. | ||
ABI_VER_MAJOR(4) | ||
|
||
/// Attempt to be ABI-compatible with code generated by Clang 6.0.x | ||
/// (SVN r321711). This causes determination of whether a type is | ||
/// standard-layout to ignore collisions between empty base classes and between | ||
/// base classes and member subobjects, which affects whether we reuse base | ||
/// class tail padding in some ABIs. | ||
ABI_VER_MAJOR(6) | ||
|
||
/// Attempt to be ABI-compatible with code generated by Clang 7.0.x | ||
/// (SVN r338536). This causes alignof (C++) and _Alignof (C11) to be compatible | ||
/// with __alignof (i.e., return the preferred alignment) rather than returning | ||
/// the required alignment. | ||
ABI_VER_MAJOR(7) | ||
|
||
/// Attempt to be ABI-compatible with code generated by Clang 9.0.x | ||
/// (SVN r351319). This causes vectors of __int128 to be passed in memory | ||
/// instead of passing in multiple scalar registers on x86_64 on Linux and | ||
/// NetBSD. | ||
ABI_VER_MAJOR(9) | ||
|
||
/// Attempt to be ABI-compatible with code generated by Clang 11.0.x | ||
/// (git 2e10b7a39b93). This causes clang to pass unions with a 256-bit vector | ||
/// member on the stack instead of using registers, to not properly mangle | ||
/// substitutions for template names in some cases, and to mangle declaration | ||
/// template arguments without a cast to the parameter type even when that can | ||
/// lead to mangling collisions. | ||
ABI_VER_MAJOR(11) | ||
|
||
/// Attempt to be ABI-compatible with code generated by Clang 12.0.x | ||
/// (git 8e464dd76bef). This causes clang to mangle lambdas within global-scope | ||
/// inline variables incorrectly. | ||
ABI_VER_MAJOR(12) | ||
|
||
/// Attempt to be ABI-compatible with code generated by Clang 14.0.x. | ||
/// This causes clang to: | ||
/// - mangle dependent nested names incorrectly. | ||
/// - make trivial only those defaulted copy constructors with a | ||
/// parameter-type-list equivalent to the parameter-type-list of an implicit | ||
/// declaration. | ||
ABI_VER_MAJOR(14) | ||
|
||
/// Attempt to be ABI-compatible with code generated by Clang 15.0.x. | ||
/// This causes clang to: | ||
/// - Reverse the implementation for CWG692, CWG1395 and CWG1432. | ||
/// - pack non-POD members of packed structs. | ||
/// - consider classes with defaulted special member functions non-pod. | ||
ABI_VER_MAJOR(15) | ||
|
||
/// Attempt to be ABI-compatible with code generated by Clang 17.0.x. | ||
/// This causes clang to revert some fixes to its implementation of the Itanium | ||
/// name mangling scheme, with the consequence that overloaded function | ||
/// templates are mangled the same if they differ only by: | ||
/// - constraints | ||
/// - whether a non-type template parameter has a deduced type | ||
/// - the parameter list of a template template parameter | ||
ABI_VER_MAJOR(17) | ||
|
||
/// Attempt to be ABI-compatible with code generated by Clang 18.0.x. | ||
/// This causes clang to revert some fixes to the mangling of lambdas in the | ||
/// initializers of members of local classes. | ||
ABI_VER_MAJOR(18) | ||
|
||
/// Attempt to be ABI-compatible with code generated by Clang 19.0.x. | ||
/// This causes clang to: | ||
/// - Incorrectly mangle the 'base type' substitutions of the CXX construction | ||
/// vtable because it hasn't added 'type' as a substitution. | ||
/// - Skip mangling enclosing class templates of member-like friend function | ||
/// templates. | ||
/// - Ignore empty struct arguments in C++ mode for ARM, instead of passing | ||
/// them as if they had a size of 1 byte. | ||
ABI_VER_MAJOR(19) | ||
|
||
/// Attempt to be ABI-compatible with code generated by Clang 20.0.x. | ||
/// This causes clang to: | ||
/// - Incorrectly return C++ records in AVX registers on x86_64. | ||
ABI_VER_MAJOR(20) | ||
|
||
/// Conform to the underlying platform's C and C++ ABIs as closely as we can. | ||
ABI_VER_LATEST(Latest) | ||
|
||
#undef ABI_VER_MAJOR_MINOR | ||
#undef ABI_VER_MAJOR | ||
#undef ABI_VER_LATEST |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::tie
takes lvalue (function signature:std::tuple<Ts&...> std::tie(Ts&... args)
), but arguments are integer literals (ABI_VER_MAJOR_MINOR(3, 8)
, seeABIVersions.def
).