1 //===------- MicrosoftCXXABI.cpp - AST support for the Microsoft C++ ABI --===//
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 C++ AST support targetting the Microsoft Visual C++
13 //===----------------------------------------------------------------------===//
16 #include "clang/AST/ASTContext.h"
17 #include "clang/AST/Type.h"
18 #include "clang/AST/DeclCXX.h"
20 using namespace clang;
23 class MicrosoftCXXABI : public CXXABI {
26 MicrosoftCXXABI(ASTContext &Ctx) : Context(Ctx) { }
28 unsigned getMemberPointerSize(const MemberPointerType *MPT) const;
32 unsigned MicrosoftCXXABI::getMemberPointerSize(const MemberPointerType *MPT) const {
33 QualType Pointee = MPT->getPointeeType();
34 CXXRecordDecl *RD = MPT->getClass()->getAsCXXRecordDecl();
35 if (RD->getNumVBases() > 0) {
36 if (Pointee->isFunctionType())
40 } else if (RD->getNumBases() > 1 && Pointee->isFunctionType())
45 CXXABI *clang::CreateMicrosoftCXXABI(ASTContext &Ctx) {
46 return new MicrosoftCXXABI(Ctx);