28 using namespace clang;
44 assert(RT &&
"type of VarDecl is expected to be RecordType.");
45 assert(RT->
getDecl()->
isUnion() &&
"RecordType is expected to be a union.");
47 return FD->getIdentifier();
56 llvm::DenseMap<const Type *, unsigned> ManglingNumbers;
57 llvm::DenseMap<const IdentifierInfo *, unsigned> VarManglingNumbers;
58 llvm::DenseMap<const IdentifierInfo *, unsigned> TagManglingNumbers;
61 unsigned getManglingNumber(
const CXXMethodDecl *CallOperator)
override {
69 Context.getFunctionType(Context.VoidTy, Proto->
getParamTypes(), EPI);
74 unsigned getManglingNumber(
const BlockDecl *BD)
override {
75 const Type *Ty =
nullptr;
76 return ++ManglingNumbers[Ty];
79 unsigned getStaticLocalNumber(
const VarDecl *VD)
override {
84 unsigned getManglingNumber(
const VarDecl *VD,
unsigned)
override {
88 Identifier = findAnonymousUnionVarDeclName(*VD);
90 return ++VarManglingNumbers[Identifier];
93 unsigned getManglingNumber(
const TagDecl *TD,
unsigned)
override {
98 class ItaniumCXXABI :
public CXXABI {
102 ItaniumCXXABI(
ASTContext &Ctx) : Context(Ctx) { }
104 std::pair<uint64_t, unsigned>
106 const TargetInfo &Target = Context.getTargetInfo();
112 return std::make_pair(Width, Align);
115 CallingConv getDefaultMethodCallConv(
bool isVariadic)
const override {
116 const llvm::Triple &T = Context.getTargetInfo().getTriple();
117 if (!isVariadic && T.isWindowsGNUEnvironment() &&
118 T.getArch() == llvm::Triple::x86)
133 Context.toCharUnitsFromBits(Context.getTargetInfo().getPointerWidth(0));
138 getCopyConstructorForExceptionObject(
CXXRecordDecl *RD)
override {
145 void addTypedefNameForUnnamedTagDecl(
TagDecl *TD,
152 void addDeclaratorForUnnamedTagDecl(
TagDecl *TD,
159 std::unique_ptr<MangleNumberingContext>
160 createMangleNumberingContext()
const override {
161 return llvm::make_unique<ItaniumNumberingContext>();
167 return new ItaniumCXXABI(Ctx);
Defines the clang::ASTContext interface.
A (possibly-)qualified type.
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names this declaration, if there is one.
C Language Family Type Representation.
The base class of the type hierarchy.
Represents a C++ constructor within a class.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
Extra information about a function prototype.
One of these records is kept for each identifier that is lexed.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
ArrayRef< QualType > getParamTypes() const
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
CharUnits - This is an opaque type for sizes expressed in character units.
Keeps track of the mangled names of lambda expressions and block literals within a particular context...
RecordDecl * getDecl() const
CXXABI * CreateItaniumCXXABI(ASTContext &Ctx)
Creates an instance of a C++ ABI class.
bool isMemberFunctionPointer() const
Returns true if the member type (i.e.
Represents a prototype with parameter type info, e.g.
Represents a ValueDecl that came out of a declarator.
unsigned getTypeWidth(IntType T) const
Return the width (in bits) of the specified integer type enum.
ASTRecordLayout - This class contains layout information for one RecordDecl, which is a struct/union/...
Exposes information about the current target.
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
Implements C++ ABI-specific semantic analysis functions.
CallingConv
CallingConv - Specifies the calling convention that a function uses.
unsigned getTypeAlign(IntType T) const
Return the alignment (in bits) of the specified integer type enum.
TagDecl - Represents the declaration of a struct/union/class/enum.
ASTContext & getASTContext() const LLVM_READONLY
Represents a static or instance method of a struct/union/class.
const T * castAs() const
Member-template castAs<specific type>.
bool isDynamicClass() const
Base class for declarations which introduce a typedef-name.
IntType
===-— Target Data Type Query Methods ----------------------------—===//
A pointer to member type per C++ 8.3.3 - Pointers to members.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
const T * getAs() const
Member-template getAs<specific type>'.
QualType getCanonicalType() const
CharUnits getNonVirtualSize() const
getNonVirtualSize - Get the non-virtual size (in chars) of an object, which is the size of the object...
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
const FieldDecl * findFirstNamedDataMember() const
Finds the first data member which has a name.
Represents a C++ struct/union/class.
Defines the clang::TargetInfo interface.
IntType getPtrDiffType(unsigned AddrSpace) const