1 //===----- CXXABI.h - Interface to C++ ABIs ---------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This provides an abstract class for C++ AST support. Concrete
11 // subclasses of this implement AST support for specific C++ ABIs.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_CLANG_AST_CXXABI_H
16 #define LLVM_CLANG_AST_CXXABI_H
18 #include "clang/AST/Type.h"
23 class MemberPointerType;
25 /// Implements C++ ABI-specific semantic analysis functions.
30 /// Returns the width and alignment of a member pointer in bits.
31 virtual std::pair<uint64_t, unsigned>
32 getMemberPointerWidthAndAlign(const MemberPointerType *MPT) const = 0;
34 /// Returns the default calling convention for C++ methods.
35 virtual CallingConv getDefaultMethodCallConv(bool isVariadic) const = 0;
37 // Returns whether the given class is nearly empty, with just virtual pointers
38 // and no data except possibly virtual bases.
39 virtual bool isNearlyEmpty(const CXXRecordDecl *RD) const = 0;
42 /// Creates an instance of a C++ ABI class.
43 CXXABI *CreateARMCXXABI(ASTContext &Ctx);
44 CXXABI *CreateItaniumCXXABI(ASTContext &Ctx);
45 CXXABI *CreateMicrosoftCXXABI(ASTContext &Ctx);