clang  3.9.0
CXXABI.h
Go to the documentation of this file.
1 //===----- CXXABI.h - Interface to C++ ABIs ---------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This provides an abstract class for C++ AST support. Concrete
11 // subclasses of this implement AST support for specific C++ ABIs.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CLANG_LIB_AST_CXXABI_H
16 #define LLVM_CLANG_LIB_AST_CXXABI_H
17 
18 #include "clang/AST/Type.h"
19 
20 namespace clang {
21 
22 class ASTContext;
23 class CXXConstructorDecl;
24 class DeclaratorDecl;
25 class Expr;
26 class MemberPointerType;
27 class MangleNumberingContext;
28 
29 /// Implements C++ ABI-specific semantic analysis functions.
30 class CXXABI {
31 public:
32  virtual ~CXXABI();
33 
34  /// Returns the width and alignment of a member pointer in bits.
35  virtual std::pair<uint64_t, unsigned>
37 
38  /// Returns the default calling convention for C++ methods.
39  virtual CallingConv getDefaultMethodCallConv(bool isVariadic) const = 0;
40 
41  /// Returns whether the given class is nearly empty, with just virtual
42  /// pointers and no data except possibly virtual bases.
43  virtual bool isNearlyEmpty(const CXXRecordDecl *RD) const = 0;
44 
45  /// Returns a new mangling number context for this C++ ABI.
47 
48  /// Adds a mapping from class to copy constructor for this C++ ABI.
50  CXXConstructorDecl *) = 0;
51 
52  /// Retrieves the mapping from class to copy constructor for this C++ ABI.
53  virtual const CXXConstructorDecl *
55 
57  unsigned ParmIdx, Expr *DAE) = 0;
58 
60  unsigned ParmIdx) = 0;
61 
63  TypedefNameDecl *DD) = 0;
64 
65  virtual TypedefNameDecl *
67 
68  virtual void addDeclaratorForUnnamedTagDecl(TagDecl *TD,
69  DeclaratorDecl *DD) = 0;
70 
72 };
73 
74 /// Creates an instance of a C++ ABI class.
77 }
78 
79 #endif
CXXABI * CreateMicrosoftCXXABI(ASTContext &Ctx)
C Language Family Type Representation.
virtual void addTypedefNameForUnnamedTagDecl(TagDecl *TD, TypedefNameDecl *DD)=0
Represents a C++ constructor within a class.
Definition: DeclCXX.h:2187
virtual const CXXConstructorDecl * getCopyConstructorForExceptionObject(CXXRecordDecl *)=0
Retrieves the mapping from class to copy constructor for this C++ ABI.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:92
Keeps track of the mangled names of lambda expressions and block literals within a particular context...
virtual CallingConv getDefaultMethodCallConv(bool isVariadic) const =0
Returns the default calling convention for C++ methods.
CXXABI * CreateItaniumCXXABI(ASTContext &Ctx)
Creates an instance of a C++ ABI class.
virtual DeclaratorDecl * getDeclaratorForUnnamedTagDecl(const TagDecl *TD)=0
Represents a ValueDecl that came out of a declarator.
Definition: Decl.h:646
friend class ASTContext
Definition: Type.h:4178
Expr - This represents one expression.
Definition: Expr.h:105
Implements C++ ABI-specific semantic analysis functions.
Definition: CXXABI.h:30
CallingConv
CallingConv - Specifies the calling convention that a function uses.
Definition: Specifiers.h:231
TagDecl - Represents the declaration of a struct/union/class/enum.
Definition: Decl.h:2727
virtual bool isNearlyEmpty(const CXXRecordDecl *RD) const =0
Returns whether the given class is nearly empty, with just virtual pointers and no data except possib...
Base class for declarations which introduce a typedef-name.
Definition: Decl.h:2609
virtual TypedefNameDecl * getTypedefNameForUnnamedTagDecl(const TagDecl *TD)=0
virtual void addDefaultArgExprForConstructor(const CXXConstructorDecl *CD, unsigned ParmIdx, Expr *DAE)=0
virtual Expr * getDefaultArgExprForConstructor(const CXXConstructorDecl *CD, unsigned ParmIdx)=0
A pointer to member type per C++ 8.3.3 - Pointers to members.
Definition: Type.h:2401
virtual ~CXXABI()
virtual void addDeclaratorForUnnamedTagDecl(TagDecl *TD, DeclaratorDecl *DD)=0
virtual void addCopyConstructorForExceptionObject(CXXRecordDecl *, CXXConstructorDecl *)=0
Adds a mapping from class to copy constructor for this C++ ABI.
Represents a C++ struct/union/class.
Definition: DeclCXX.h:263
virtual std::pair< uint64_t, unsigned > getMemberPointerWidthAndAlign(const MemberPointerType *MPT) const =0
Returns the width and alignment of a member pointer in bits.
virtual MangleNumberingContext * createMangleNumberingContext() const =0
Returns a new mangling number context for this C++ ABI.