blob: ea2e55fcb28b870414d7a56795712317bb760054 [file] [log] [blame]
Charles Davisc3926642010-06-09 23:25:41 +00001//===--- MicrosoftCXXABI.cpp - Emit LLVM Code from ASTs for a Module ------===//
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++ code generation targetting the Microsoft Visual C++ ABI.
11// The class in this file generates structures that follow the Microsoft
12// Visual C++ ABI, which is actually not very well documented at all outside
13// of Microsoft.
14//
15//===----------------------------------------------------------------------===//
16
17#include "CGCXXABI.h"
18#include "CodeGenModule.h"
Charles Davisc3926642010-06-09 23:25:41 +000019#include "clang/AST/Decl.h"
20#include "clang/AST/DeclCXX.h"
Charles Davisc3926642010-06-09 23:25:41 +000021
22using namespace clang;
23using namespace CodeGen;
24
25namespace {
26
Charles Davis071cc7d2010-08-16 03:33:14 +000027class MicrosoftCXXABI : public CGCXXABI {
Charles Davisc3926642010-06-09 23:25:41 +000028public:
Peter Collingbourne14110472011-01-13 18:57:25 +000029 MicrosoftCXXABI(CodeGenModule &CGM) : CGCXXABI(CGM) {}
John McCall4c40d982010-08-31 07:33:07 +000030
31 void BuildConstructorSignature(const CXXConstructorDecl *Ctor,
32 CXXCtorType Type,
33 CanQualType &ResTy,
34 llvm::SmallVectorImpl<CanQualType> &ArgTys) {
35 // 'this' is already in place
36 // TODO: 'for base' flag
37 }
38
39 void BuildDestructorSignature(const CXXDestructorDecl *Ctor,
40 CXXDtorType Type,
41 CanQualType &ResTy,
42 llvm::SmallVectorImpl<CanQualType> &ArgTys) {
43 // 'this' is already in place
44 // TODO: 'for base' flag
45 }
46
47 void BuildInstanceFunctionParams(CodeGenFunction &CGF,
48 QualType &ResTy,
49 FunctionArgList &Params) {
50 BuildThisParam(CGF, Params);
51 // TODO: 'for base' flag
52 }
53
54 void EmitInstanceFunctionProlog(CodeGenFunction &CGF) {
55 EmitThisParam(CGF);
56 // TODO: 'for base' flag
57 }
Charles Davisc3926642010-06-09 23:25:41 +000058};
59
60}
61
Charles Davis071cc7d2010-08-16 03:33:14 +000062CGCXXABI *clang::CodeGen::CreateMicrosoftCXXABI(CodeGenModule &CGM) {
Charles Davisc3926642010-06-09 23:25:41 +000063 return new MicrosoftCXXABI(CGM);
64}
65