Go to the documentation of this file.
15 #ifndef LLVM_CLANG_BASIC_TARGETCXXABI_H
16 #define LLVM_CLANG_BASIC_TARGETCXXABI_H
21 #include "llvm/ADT/StringMap.h"
22 #include "llvm/ADT/Triple.h"
23 #include "llvm/Support/ErrorHandling.h"
32 #define CXXABI(Name, Str) Name,
33 #include "TargetCXXABI.def"
42 static const auto &getABIMap() {
43 static llvm::StringMap<Kind> ABIMap = {
44 #define CXXABI(Name, Str) {Str, Name},
45 #include "TargetCXXABI.def"
50 static const auto &getSpellingMap() {
51 static std::map<Kind, std::string> SpellingMap = {
52 #define CXXABI(Name, Str) {Name, Str},
53 #include "TargetCXXABI.def"
59 static Kind getKind(StringRef Name) {
return getABIMap().lookup(Name); }
61 return getSpellingMap().find(ABIKind)->second;
63 static bool isABI(StringRef Name) {
64 return getABIMap().find(Name) != getABIMap().end();
70 return T.isOSFuchsia();
92 return T.isARM() || T.isAArch64();
97 return T.isOSDarwin();
100 return T.isOSFuchsia();
103 return T.isAArch64();
118 return T.isKnownWindowsMSVCEnvironment();
120 llvm_unreachable(
"invalid CXXABI kind");
126 #define CXXABI(Name, Str)
127 #define ITANIUM_CXXABI(Name, Str) case Name:
128 #include "TargetCXXABI.def"
134 llvm_unreachable(
"bad ABI kind");
140 #define CXXABI(Name, Str)
141 #define MICROSOFT_CXXABI(Name, Str) case Name:
142 #include "TargetCXXABI.def"
148 llvm_unreachable(
"bad ABI kind");
180 llvm_unreachable(
"bad ABI kind");
257 llvm_unreachable(
"bad ABI kind");
308 llvm_unreachable(
"bad ABI kind");
316 return !(left == right);
TailPaddingUseRules
When is record layout allowed to allocate objects in the tail padding of a base class?
bool isMicrosoft() const
Is this ABI an MSVC-compatible ABI?
bool hasKeyFunctions() const
Does this ABI use key functions? If so, class data such as the vtable is emitted with strong linkage ...
friend bool operator!=(const TargetCXXABI &left, const TargetCXXABI &right)
bool isItaniumFamily() const
Does this ABI generally fall into the Itanium family of ABIs?
TailPaddingUseRules getTailPaddingUseRules() const
static Kind getKind(StringRef Name)
Kind
The basic C++ ABI kind.
friend bool operator==(const TargetCXXABI &left, const TargetCXXABI &right)
bool canKeyFunctionBeInline() const
Can an out-of-line inline function serve as a key function?
@ UseTailPaddingUnlessPOD11
Only allocate objects in the tail padding of a base class if the base class is not POD according to t...
TargetCXXABI()
A bogus initialization of the platform ABI.
static bool isABI(StringRef Name)
@ UseTailPaddingUnlessPOD03
Only allocate objects in the tail padding of a base class if the base class is not POD according to t...
static bool isSupportedCXXABI(const llvm::Triple &T, Kind Kind)
@ Microsoft
Is the identifier known as a [] Microsoft-style attribute?
@ AlwaysUseTailPadding
The tail-padding of a base class is always theoretically available, even if it's POD.
bool hasConstructorVariants() const
Does this ABI have different entrypoints for complete-object and base-subobject constructors?
bool hasPrimaryVBases() const
Does this ABI allow virtual bases to be primary base classes?
static const auto & getSpelling(Kind ABIKind)
bool areArgsDestroyedLeftToRightInCallee() const
Are arguments to a call destroyed left to right in the callee? This is a fundamental language change,...
bool areMemberFunctionsAligned() const
Are member functions differently aligned?
unsigned kind
All of the diagnostics that can be emitted by the frontend.
The basic abstraction for the target C++ ABI.
static bool usesRelativeVTables(const llvm::Triple &T)