blob: 899e5e7b258a430ae0cce39bb8e7a1bd8271fa5b [file] [log] [blame]
Charles Davis3a811f12010-05-25 19:52:27 +00001//===----- CGCXXABI.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++ code generation. Concrete subclasses
11// of this implement code generation for specific C++ ABIs.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef CLANG_CODEGEN_CXXABI_H
16#define CLANG_CODEGEN_CXXABI_H
17
John McCall4c40d982010-08-31 07:33:07 +000018#include "CodeGenFunction.h"
Chandler Carruth55fc8732012-12-04 09:13:33 +000019#include "clang/Basic/LLVM.h"
John McCall4c40d982010-08-31 07:33:07 +000020
John McCall93d557b2010-08-22 00:05:51 +000021namespace llvm {
John McCallcf2c85e2010-08-22 04:16:24 +000022 class Constant;
John McCall0bab0cd2010-08-23 01:21:21 +000023 class Type;
John McCall93d557b2010-08-22 00:05:51 +000024 class Value;
25}
26
Charles Davis3a811f12010-05-25 19:52:27 +000027namespace clang {
John McCall3023def2010-08-22 03:04:22 +000028 class CastExpr;
John McCall4c40d982010-08-31 07:33:07 +000029 class CXXConstructorDecl;
30 class CXXDestructorDecl;
John McCall875ab102010-08-22 06:43:33 +000031 class CXXMethodDecl;
John McCallcf2c85e2010-08-22 04:16:24 +000032 class CXXRecordDecl;
John McCall0bab0cd2010-08-23 01:21:21 +000033 class FieldDecl;
Peter Collingbourne14110472011-01-13 18:57:25 +000034 class MangleContext;
John McCall93d557b2010-08-22 00:05:51 +000035
Charles Davis3a811f12010-05-25 19:52:27 +000036namespace CodeGen {
John McCall93d557b2010-08-22 00:05:51 +000037 class CodeGenFunction;
Charles Davis3a811f12010-05-25 19:52:27 +000038 class CodeGenModule;
Charles Davis3a811f12010-05-25 19:52:27 +000039
James Dennett3b2adf22012-06-15 07:35:42 +000040/// \brief Implements C++ ABI-specific code generation functions.
Charles Davis071cc7d2010-08-16 03:33:14 +000041class CGCXXABI {
John McCalld608cdb2010-08-22 10:59:02 +000042protected:
43 CodeGenModule &CGM;
Dylan Noblesmith6f42b622012-02-05 02:12:40 +000044 OwningPtr<MangleContext> MangleCtx;
John McCalld608cdb2010-08-22 10:59:02 +000045
Peter Collingbourne14110472011-01-13 18:57:25 +000046 CGCXXABI(CodeGenModule &CGM)
47 : CGM(CGM), MangleCtx(CGM.getContext().createMangleContext()) {}
John McCalld608cdb2010-08-22 10:59:02 +000048
John McCall4c40d982010-08-31 07:33:07 +000049protected:
50 ImplicitParamDecl *&getThisDecl(CodeGenFunction &CGF) {
Eli Friedmancec5ebd2012-02-11 02:57:39 +000051 return CGF.CXXABIThisDecl;
John McCall4c40d982010-08-31 07:33:07 +000052 }
53 llvm::Value *&getThisValue(CodeGenFunction &CGF) {
Eli Friedmancec5ebd2012-02-11 02:57:39 +000054 return CGF.CXXABIThisValue;
John McCall4c40d982010-08-31 07:33:07 +000055 }
56
Reid Klecknera8a0f762013-03-22 19:02:54 +000057 /// Issue a diagnostic about unsupported features in the ABI.
58 void ErrorUnsupportedABI(CodeGenFunction &CGF, StringRef S);
59
60 /// Get a null value for unsupported member pointers.
61 llvm::Constant *GetBogusMemberPointer(QualType T);
62
Timur Iskhodzhanov59660c22013-02-13 08:37:51 +000063 // FIXME: Every place that calls getVTT{Decl,Value} is something
64 // that needs to be abstracted properly.
John McCall4c40d982010-08-31 07:33:07 +000065 ImplicitParamDecl *&getVTTDecl(CodeGenFunction &CGF) {
Timur Iskhodzhanov59660c22013-02-13 08:37:51 +000066 return CGF.CXXStructorImplicitParamDecl;
John McCall4c40d982010-08-31 07:33:07 +000067 }
68 llvm::Value *&getVTTValue(CodeGenFunction &CGF) {
Timur Iskhodzhanov59660c22013-02-13 08:37:51 +000069 return CGF.CXXStructorImplicitParamValue;
70 }
71
72 ImplicitParamDecl *&getStructorImplicitParamDecl(CodeGenFunction &CGF) {
73 return CGF.CXXStructorImplicitParamDecl;
74 }
75 llvm::Value *&getStructorImplicitParamValue(CodeGenFunction &CGF) {
76 return CGF.CXXStructorImplicitParamValue;
John McCall4c40d982010-08-31 07:33:07 +000077 }
78
79 /// Build a parameter variable suitable for 'this'.
80 void BuildThisParam(CodeGenFunction &CGF, FunctionArgList &Params);
81
82 /// Perform prolog initialization of the parameter variable suitable
83 /// for 'this' emitted by BuildThisParam.
84 void EmitThisParam(CodeGenFunction &CGF);
85
John McCall1e7fe752010-09-02 09:58:18 +000086 ASTContext &getContext() const { return CGM.getContext(); }
87
John McCalle2b45e22012-05-01 05:23:51 +000088 virtual bool requiresArrayCookie(const CXXDeleteExpr *E, QualType eltType);
89 virtual bool requiresArrayCookie(const CXXNewExpr *E);
90
Charles Davis3a811f12010-05-25 19:52:27 +000091public:
John McCalld608cdb2010-08-22 10:59:02 +000092
Anders Carlsson1af610f2010-11-28 17:50:09 +000093 virtual ~CGCXXABI();
Charles Davis3a811f12010-05-25 19:52:27 +000094
95 /// Gets the mangle context.
Peter Collingbourne14110472011-01-13 18:57:25 +000096 MangleContext &getMangleContext() {
97 return *MangleCtx;
98 }
John McCall93d557b2010-08-22 00:05:51 +000099
Stephen Lind4c0cd02013-06-18 17:00:49 +0000100 /// Returns true if the given constructor or destructor is one of the
101 /// kinds that the ABI says returns 'this' (only applies when called
102 /// non-virtually for destructors).
103 ///
104 /// There currently is no way to indicate if a destructor returns 'this'
105 /// when called virtually, and code generation does not support the case.
Manman Ren63fd4082013-03-20 16:59:38 +0000106 virtual bool HasThisReturn(GlobalDecl GD) const { return false; }
107
Timur Iskhodzhanoved23bdf2013-04-17 12:54:10 +0000108 /// Returns true if the given record type should be returned indirectly.
109 virtual bool isReturnTypeIndirect(const CXXRecordDecl *RD) const = 0;
110
111 /// Specify how one should pass an argument of a record type.
112 enum RecordArgABI {
113 /// Pass it using the normal C aggregate rules for the ABI, potentially
114 /// introducing extra copies and passing some or all of it in registers.
115 RAA_Default = 0,
116
117 /// Pass it on the stack using its defined layout. The argument must be
118 /// evaluated directly into the correct stack position in the arguments area,
119 /// and the call machinery must not move it or introduce extra copies.
120 RAA_DirectInMemory,
121
122 /// Pass it as a pointer to temporary memory.
123 RAA_Indirect
124 };
125
126 /// Returns how an argument of the given record type should be passed.
127 virtual RecordArgABI getRecordArgABI(const CXXRecordDecl *RD) const = 0;
128
John McCall0bab0cd2010-08-23 01:21:21 +0000129 /// Find the LLVM type used to represent the given member pointer
130 /// type.
Chris Lattner9cbe4f02011-07-09 17:41:47 +0000131 virtual llvm::Type *
John McCall0bab0cd2010-08-23 01:21:21 +0000132 ConvertMemberPointerType(const MemberPointerType *MPT);
133
134 /// Load a member function from an object and a member function
135 /// pointer. Apply the this-adjustment and set 'This' to the
136 /// adjusted value.
John McCall93d557b2010-08-22 00:05:51 +0000137 virtual llvm::Value *
138 EmitLoadOfMemberFunctionPointer(CodeGenFunction &CGF,
139 llvm::Value *&This,
140 llvm::Value *MemPtr,
141 const MemberPointerType *MPT);
John McCall3023def2010-08-22 03:04:22 +0000142
John McCall6c2ab1d2010-08-31 21:07:20 +0000143 /// Calculate an l-value from an object and a data member pointer.
144 virtual llvm::Value *EmitMemberDataPointerAddress(CodeGenFunction &CGF,
145 llvm::Value *Base,
146 llvm::Value *MemPtr,
147 const MemberPointerType *MPT);
148
John McCall4d4e5c12012-02-15 01:22:51 +0000149 /// Perform a derived-to-base, base-to-derived, or bitcast member
150 /// pointer conversion.
John McCall0bab0cd2010-08-23 01:21:21 +0000151 virtual llvm::Value *EmitMemberPointerConversion(CodeGenFunction &CGF,
152 const CastExpr *E,
153 llvm::Value *Src);
John McCallcf2c85e2010-08-22 04:16:24 +0000154
John McCall4d4e5c12012-02-15 01:22:51 +0000155 /// Perform a derived-to-base, base-to-derived, or bitcast member
156 /// pointer conversion on a constant value.
157 virtual llvm::Constant *EmitMemberPointerConversion(const CastExpr *E,
158 llvm::Constant *Src);
159
John McCall0bab0cd2010-08-23 01:21:21 +0000160 /// Return true if the given member pointer can be zero-initialized
161 /// (in the C++ sense) with an LLVM zeroinitializer.
John McCallf16aa102010-08-22 21:01:12 +0000162 virtual bool isZeroInitializable(const MemberPointerType *MPT);
John McCallcf2c85e2010-08-22 04:16:24 +0000163
John McCall0bab0cd2010-08-23 01:21:21 +0000164 /// Create a null member pointer of the given type.
165 virtual llvm::Constant *EmitNullMemberPointer(const MemberPointerType *MPT);
John McCallcf2c85e2010-08-22 04:16:24 +0000166
John McCall0bab0cd2010-08-23 01:21:21 +0000167 /// Create a member pointer for the given method.
John McCall755d8492011-04-12 00:42:48 +0000168 virtual llvm::Constant *EmitMemberPointer(const CXXMethodDecl *MD);
John McCall875ab102010-08-22 06:43:33 +0000169
John McCall0bab0cd2010-08-23 01:21:21 +0000170 /// Create a member pointer for the given field.
John McCall5808ce42011-02-03 08:15:49 +0000171 virtual llvm::Constant *EmitMemberDataPointer(const MemberPointerType *MPT,
172 CharUnits offset);
John McCalle9fd7eb2010-08-22 08:30:07 +0000173
Richard Smith2d6a5672012-01-14 04:30:29 +0000174 /// Create a member pointer for the given member pointer constant.
175 virtual llvm::Constant *EmitMemberPointer(const APValue &MP, QualType MPT);
176
John McCall0bab0cd2010-08-23 01:21:21 +0000177 /// Emit a comparison between two member pointers. Returns an i1.
John McCalle9fd7eb2010-08-22 08:30:07 +0000178 virtual llvm::Value *
John McCall0bab0cd2010-08-23 01:21:21 +0000179 EmitMemberPointerComparison(CodeGenFunction &CGF,
180 llvm::Value *L,
181 llvm::Value *R,
182 const MemberPointerType *MPT,
183 bool Inequality);
John McCalle9fd7eb2010-08-22 08:30:07 +0000184
John McCall0bab0cd2010-08-23 01:21:21 +0000185 /// Determine if a member pointer is non-null. Returns an i1.
John McCalle9fd7eb2010-08-22 08:30:07 +0000186 virtual llvm::Value *
John McCall0bab0cd2010-08-23 01:21:21 +0000187 EmitMemberPointerIsNotNull(CodeGenFunction &CGF,
188 llvm::Value *MemPtr,
189 const MemberPointerType *MPT);
John McCall4c40d982010-08-31 07:33:07 +0000190
John McCall4d4e5c12012-02-15 01:22:51 +0000191protected:
192 /// A utility method for computing the offset required for the given
193 /// base-to-derived or derived-to-base member-pointer conversion.
194 /// Does not handle virtual conversions (in case we ever fully
195 /// support an ABI that allows this). Returns null if no adjustment
196 /// is required.
197 llvm::Constant *getMemberPointerAdjustment(const CastExpr *E);
198
Reid Klecknerf6327302013-05-09 21:01:17 +0000199 /// \brief Computes the non-virtual adjustment needed for a member pointer
200 /// conversion along an inheritance path stored in an APValue. Unlike
201 /// getMemberPointerAdjustment(), the adjustment can be negative if the path
202 /// is from a derived type to a base type.
203 CharUnits getMemberPointerPathAdjustment(const APValue &MP);
204
John McCall4d4e5c12012-02-15 01:22:51 +0000205public:
John McCallecd03b42012-09-25 10:10:39 +0000206 /// Adjust the given non-null pointer to an object of polymorphic
207 /// type to point to the complete object.
208 ///
209 /// The IR type of the result should be a pointer but is otherwise
210 /// irrelevant.
211 virtual llvm::Value *adjustToCompleteObject(CodeGenFunction &CGF,
212 llvm::Value *ptr,
213 QualType type) = 0;
214
Reid Klecknerb0f533e2013-05-29 18:02:47 +0000215 virtual llvm::Value *GetVirtualBaseClassOffset(CodeGenFunction &CGF,
216 llvm::Value *This,
217 const CXXRecordDecl *ClassDecl,
218 const CXXRecordDecl *BaseClassDecl) = 0;
219
John McCall4c40d982010-08-31 07:33:07 +0000220 /// Build the signature of the given constructor variant by adding
Stephen Lind4c0cd02013-06-18 17:00:49 +0000221 /// any required parameters. For convenience, ArgTys has been initialized
222 /// with the type of 'this' and ResTy has been initialized with the type of
223 /// 'this' if HasThisReturn(GlobalDecl(Ctor, T)) is true or 'void' otherwise
224 /// (although both may be changed by the ABI).
John McCall4c40d982010-08-31 07:33:07 +0000225 ///
226 /// If there are ever any ABIs where the implicit parameters are
227 /// intermixed with the formal parameters, we can address those
228 /// then.
229 virtual void BuildConstructorSignature(const CXXConstructorDecl *Ctor,
230 CXXCtorType T,
231 CanQualType &ResTy,
Chris Lattner686775d2011-07-20 06:58:45 +0000232 SmallVectorImpl<CanQualType> &ArgTys) = 0;
John McCall4c40d982010-08-31 07:33:07 +0000233
Timur Iskhodzhanov1d4fff52013-02-27 13:46:31 +0000234 virtual llvm::BasicBlock *EmitCtorCompleteObjectHandler(CodeGenFunction &CGF);
235
John McCall4c40d982010-08-31 07:33:07 +0000236 /// Build the signature of the given destructor variant by adding
Stephen Lind4c0cd02013-06-18 17:00:49 +0000237 /// any required parameters. For convenience, ArgTys has been initialized
238 /// with the type of 'this' and ResTy has been initialized with the type of
239 /// 'this' if HasThisReturn(GlobalDecl(Dtor, T)) is true or 'void' otherwise
240 /// (although both may be changed by the ABI).
John McCall4c40d982010-08-31 07:33:07 +0000241 virtual void BuildDestructorSignature(const CXXDestructorDecl *Dtor,
242 CXXDtorType T,
243 CanQualType &ResTy,
Chris Lattner686775d2011-07-20 06:58:45 +0000244 SmallVectorImpl<CanQualType> &ArgTys) = 0;
John McCall4c40d982010-08-31 07:33:07 +0000245
246 /// Build the ABI-specific portion of the parameter list for a
247 /// function. This generally involves a 'this' parameter and
248 /// possibly some extra data for constructors and destructors.
249 ///
250 /// ABIs may also choose to override the return type, which has been
Stephen Lind4c0cd02013-06-18 17:00:49 +0000251 /// initialized with the type of 'this' if HasThisReturn(CGF.CurGD) is true or
252 /// the formal return type of the function otherwise.
John McCall4c40d982010-08-31 07:33:07 +0000253 virtual void BuildInstanceFunctionParams(CodeGenFunction &CGF,
254 QualType &ResTy,
255 FunctionArgList &Params) = 0;
256
257 /// Emit the ABI-specific prolog for the function.
258 virtual void EmitInstanceFunctionProlog(CodeGenFunction &CGF) = 0;
259
Manman Ren63fd4082013-03-20 16:59:38 +0000260 /// Emit the constructor call. Return the function that is called.
Stephen Lind4c0cd02013-06-18 17:00:49 +0000261 virtual RValue EmitConstructorCall(CodeGenFunction &CGF,
262 const CXXConstructorDecl *D,
263 CXXCtorType Type,
264 bool ForVirtualBase, bool Delegating,
265 ReturnValueSlot ReturnValue,
266 llvm::Value *This,
267 CallExpr::const_arg_iterator ArgBeg,
268 CallExpr::const_arg_iterator ArgEnd) = 0;
Timur Iskhodzhanov1d4fff52013-02-27 13:46:31 +0000269
Timur Iskhodzhanov0f9827f2013-02-15 14:45:22 +0000270 /// Emit the ABI-specific virtual destructor call.
271 virtual RValue EmitVirtualDestructorCall(CodeGenFunction &CGF,
272 const CXXDestructorDecl *Dtor,
273 CXXDtorType DtorType,
274 SourceLocation CallLoc,
275 ReturnValueSlot ReturnValue,
276 llvm::Value *This) = 0;
277
John McCall4c40d982010-08-31 07:33:07 +0000278 virtual void EmitReturnFromThunk(CodeGenFunction &CGF,
279 RValue RV, QualType ResultType);
John McCall1e7fe752010-09-02 09:58:18 +0000280
Joao Matos285baac2012-07-17 17:10:11 +0000281 /// Gets the pure virtual member call function.
282 virtual StringRef GetPureVirtualCallName() = 0;
283
David Blaikie2eb9a952012-10-16 22:56:05 +0000284 /// Gets the deleted virtual member call name.
285 virtual StringRef GetDeletedVirtualCallName() = 0;
286
John McCall1e7fe752010-09-02 09:58:18 +0000287 /**************************** Array cookies ******************************/
288
289 /// Returns the extra size required in order to store the array
James Dennett16ae9de2012-06-22 10:16:05 +0000290 /// cookie for the given new-expression. May return 0 to indicate that no
John McCall1e7fe752010-09-02 09:58:18 +0000291 /// array cookie is required.
292 ///
293 /// Several cases are filtered out before this method is called:
294 /// - non-array allocations never need a cookie
James Dennett59001032012-06-20 00:57:15 +0000295 /// - calls to \::operator new(size_t, void*) never need a cookie
John McCall1e7fe752010-09-02 09:58:18 +0000296 ///
James Dennett16ae9de2012-06-22 10:16:05 +0000297 /// \param expr - the new-expression being allocated.
John McCall6ec278d2011-01-27 09:37:56 +0000298 virtual CharUnits GetArrayCookieSize(const CXXNewExpr *expr);
John McCall1e7fe752010-09-02 09:58:18 +0000299
300 /// Initialize the array cookie for the given allocation.
301 ///
302 /// \param NewPtr - a char* which is the presumed-non-null
303 /// return value of the allocation function
304 /// \param NumElements - the computed number of elements,
John McCalle2b45e22012-05-01 05:23:51 +0000305 /// potentially collapsed from the multidimensional array case;
306 /// always a size_t
John McCall1e7fe752010-09-02 09:58:18 +0000307 /// \param ElementType - the base element allocated type,
308 /// i.e. the allocated type after stripping all array types
309 virtual llvm::Value *InitializeArrayCookie(CodeGenFunction &CGF,
310 llvm::Value *NewPtr,
311 llvm::Value *NumElements,
John McCall6ec278d2011-01-27 09:37:56 +0000312 const CXXNewExpr *expr,
John McCall1e7fe752010-09-02 09:58:18 +0000313 QualType ElementType);
314
315 /// Reads the array cookie associated with the given pointer,
316 /// if it has one.
317 ///
318 /// \param Ptr - a pointer to the first element in the array
319 /// \param ElementType - the base element type of elements of the array
320 /// \param NumElements - an out parameter which will be initialized
321 /// with the number of elements allocated, or zero if there is no
322 /// cookie
323 /// \param AllocPtr - an out parameter which will be initialized
324 /// with a char* pointing to the address returned by the allocation
325 /// function
326 /// \param CookieSize - an out parameter which will be initialized
327 /// with the size of the cookie, or zero if there is no cookie
328 virtual void ReadArrayCookie(CodeGenFunction &CGF, llvm::Value *Ptr,
John McCall6ec278d2011-01-27 09:37:56 +0000329 const CXXDeleteExpr *expr,
John McCall1e7fe752010-09-02 09:58:18 +0000330 QualType ElementType, llvm::Value *&NumElements,
331 llvm::Value *&AllocPtr, CharUnits &CookieSize);
332
John McCalle2b45e22012-05-01 05:23:51 +0000333protected:
334 /// Returns the extra size required in order to store the array
335 /// cookie for the given type. Assumes that an array cookie is
336 /// required.
337 virtual CharUnits getArrayCookieSizeImpl(QualType elementType);
338
339 /// Reads the array cookie for an allocation which is known to have one.
340 /// This is called by the standard implementation of ReadArrayCookie.
341 ///
342 /// \param ptr - a pointer to the allocation made for an array, as a char*
343 /// \param cookieSize - the computed cookie size of an array
James Dennett3b2adf22012-06-15 07:35:42 +0000344 ///
John McCalle2b45e22012-05-01 05:23:51 +0000345 /// Other parameters are as above.
James Dennett3b2adf22012-06-15 07:35:42 +0000346 ///
John McCalle2b45e22012-05-01 05:23:51 +0000347 /// \return a size_t
348 virtual llvm::Value *readArrayCookieImpl(CodeGenFunction &IGF,
349 llvm::Value *ptr,
350 CharUnits cookieSize);
351
352public:
353
John McCall5cd91b52010-09-08 01:44:27 +0000354 /*************************** Static local guards ****************************/
355
John McCall3030eb82010-11-06 09:44:32 +0000356 /// Emits the guarded initializer and destructor setup for the given
357 /// variable, given that it couldn't be emitted as a constant.
Richard Smith7ca48502012-02-13 22:16:19 +0000358 /// If \p PerformInit is false, the initialization has been folded to a
359 /// constant and should not be performed.
John McCall3030eb82010-11-06 09:44:32 +0000360 ///
361 /// The variable may be:
362 /// - a static local variable
363 /// - a static data member of a class template instantiation
364 virtual void EmitGuardedInit(CodeGenFunction &CGF, const VarDecl &D,
Chandler Carruth0f30a122012-03-30 19:44:53 +0000365 llvm::GlobalVariable *DeclPtr, bool PerformInit);
John McCall5cd91b52010-09-08 01:44:27 +0000366
John McCall20bb1752012-05-01 06:13:13 +0000367 /// Emit code to force the execution of a destructor during global
368 /// teardown. The default implementation of this uses atexit.
369 ///
370 /// \param dtor - a function taking a single pointer argument
371 /// \param addr - a pointer to pass to the destructor function.
Richard Smith04e51762013-04-14 23:01:42 +0000372 virtual void registerGlobalDtor(CodeGenFunction &CGF, const VarDecl &D,
373 llvm::Constant *dtor, llvm::Constant *addr);
Richard Smithb80a16e2013-04-19 16:42:07 +0000374
375 /*************************** thread_local initialization ********************/
376
377 /// Emits ABI-required functions necessary to initialize thread_local
378 /// variables in this translation unit.
379 ///
380 /// \param Decls The thread_local declarations in this translation unit.
381 /// \param InitFunc If this translation unit contains any non-constant
382 /// initialization or non-trivial destruction for thread_local
383 /// variables, a function to perform the initialization. Otherwise, 0.
384 virtual void EmitThreadLocalInitFuncs(
385 llvm::ArrayRef<std::pair<const VarDecl *, llvm::GlobalVariable *> > Decls,
386 llvm::Function *InitFunc);
387
388 /// Emit a reference to a non-local thread_local variable (including
389 /// triggering the initialization of all thread_local variables in its
390 /// translation unit).
391 virtual LValue EmitThreadLocalDeclRefExpr(CodeGenFunction &CGF,
392 const DeclRefExpr *DRE);
Charles Davis3a811f12010-05-25 19:52:27 +0000393};
394
John McCall96fcde02013-01-25 23:36:14 +0000395// Create an instance of a C++ ABI class:
396
397/// Creates an Itanium-family ABI.
Charles Davis071cc7d2010-08-16 03:33:14 +0000398CGCXXABI *CreateItaniumCXXABI(CodeGenModule &CGM);
John McCall96fcde02013-01-25 23:36:14 +0000399
400/// Creates a Microsoft-family ABI.
Charles Davis071cc7d2010-08-16 03:33:14 +0000401CGCXXABI *CreateMicrosoftCXXABI(CodeGenModule &CGM);
John McCall93d557b2010-08-22 00:05:51 +0000402
Charles Davis3a811f12010-05-25 19:52:27 +0000403}
404}
405
406#endif