blob: 0ac80ecd6384bd3471a48d6906ceae06f12dfad9 [file] [log] [blame]
Charles Davis071cc7d2010-08-16 03:33:14 +00001//===------- ItaniumCXXABI.cpp - AST support for the Itanium C++ ABI ------===//
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 C++ AST support targetting the Itanium C++ ABI, which is
11// documented at:
12// http://www.codesourcery.com/public/cxx-abi/abi.html
13// http://www.codesourcery.com/public/cxx-abi/abi-eh.html
14//===----------------------------------------------------------------------===//
15
16#include "CXXABI.h"
17#include "clang/AST/ASTContext.h"
18#include "clang/AST/Type.h"
19
20using namespace clang;
21
22namespace {
23class ItaniumCXXABI : public CXXABI {
24 ASTContext &Context;
25public:
26 ItaniumCXXABI(ASTContext &Ctx) : Context(Ctx) { }
27
28 unsigned getMemberPointerSize(const MemberPointerType *MPT) const {
29 QualType Pointee = MPT->getPointeeType();
30 if (Pointee->isFunctionType()) return 2;
31 return 1;
32 }
33};
34}
35
36CXXABI *clang::CreateItaniumCXXABI(ASTContext &Ctx) {
37 return new ItaniumCXXABI(Ctx);
38}
39