15#ifndef LLVM_CLANG_BASIC_TARGETCXXABI_H
16#define LLVM_CLANG_BASIC_TARGETCXXABI_H
21#include "llvm/ADT/StringMap.h"
22#include "llvm/Support/ErrorHandling.h"
23#include "llvm/TargetParser/Triple.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) {
return getABIMap().contains(Name); }
68 return T.isOSFuchsia();
90 return T.isARM() ||
T.isAArch64();
95 return T.isOSDarwin();
98 return T.isOSFuchsia();
101 return T.isAArch64();
116 return T.isKnownWindowsMSVCEnvironment();
118 llvm_unreachable(
"invalid CXXABI kind");
124#define CXXABI(Name, Str)
125#define ITANIUM_CXXABI(Name, Str) case Name:
126#include "TargetCXXABI.def"
132 llvm_unreachable(
"bad ABI kind");
138#define CXXABI(Name, Str)
139#define MICROSOFT_CXXABI(Name, Str) case Name:
140#include "TargetCXXABI.def"
146 llvm_unreachable(
"bad ABI kind");
178 llvm_unreachable(
"bad ABI kind");
255 llvm_unreachable(
"bad ABI kind");
306 llvm_unreachable(
"bad ABI kind");
314 return !(left == right);
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
The basic abstraction for the target C++ ABI.
TargetCXXABI()
A bogus initialization of the platform ABI.
static bool isSupportedCXXABI(const llvm::Triple &T, Kind Kind)
static const auto & getSpelling(Kind ABIKind)
static bool usesRelativeVTables(const llvm::Triple &T)
TailPaddingUseRules getTailPaddingUseRules() const
bool hasConstructorVariants() const
Does this ABI have different entrypoints for complete-object and base-subobject constructors?
bool areArgsDestroyedLeftToRightInCallee() const
Are arguments to a call destroyed left to right in the callee? This is a fundamental language change,...
bool isMicrosoft() const
Is this ABI an MSVC-compatible ABI?
bool hasPrimaryVBases() const
Does this ABI allow virtual bases to be primary base classes?
static bool isABI(StringRef Name)
bool canKeyFunctionBeInline() const
Can an out-of-line inline function serve as a key function?
friend bool operator==(const TargetCXXABI &left, const TargetCXXABI &right)
TailPaddingUseRules
When is record layout allowed to allocate objects in the tail padding of a base class?
@ AlwaysUseTailPadding
The tail-padding of a base class is always theoretically available, even if it's POD.
@ UseTailPaddingUnlessPOD11
Only allocate objects in the tail padding of a base class if the base class is not POD according to t...
@ UseTailPaddingUnlessPOD03
Only allocate objects in the tail padding of a base class if the base class is not POD according to t...
bool isItaniumFamily() const
Does this ABI generally fall into the Itanium family of ABIs?
bool areMemberFunctionsAligned() const
Are member functions differently aligned?
bool hasKeyFunctions() const
Does this ABI use key functions? If so, class data such as the vtable is emitted with strong linkage ...
Kind
The basic C++ ABI kind.
static Kind getKind(StringRef Name)
friend bool operator!=(const TargetCXXABI &left, const TargetCXXABI &right)
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T