CGCXXABI.h revision 6ec278d1a354517e20f13a877481453ee7940c78
13a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis//===----- CGCXXABI.h - Interface to C++ ABIs -------------------*- C++ -*-===// 23a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis// 33a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis// The LLVM Compiler Infrastructure 43a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis// 53a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis// This file is distributed under the University of Illinois Open Source 63a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis// License. See LICENSE.TXT for details. 73a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis// 83a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis//===----------------------------------------------------------------------===// 93a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis// 103a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis// This provides an abstract class for C++ code generation. Concrete subclasses 113a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis// of this implement code generation for specific C++ ABIs. 123a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis// 133a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis//===----------------------------------------------------------------------===// 143a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis 153a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis#ifndef CLANG_CODEGEN_CXXABI_H 163a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis#define CLANG_CODEGEN_CXXABI_H 173a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis 184c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall#include "CodeGenFunction.h" 194c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall 2093d557bc1867b7d7b102f87290194b4be7932c92John McCallnamespace llvm { 21cf2c85e76fdafe7e634810a292321a6c8322483dJohn McCall class Constant; 220bab0cdab751248ca389a5592bcb70eac5d39260John McCall class Type; 2393d557bc1867b7d7b102f87290194b4be7932c92John McCall class Value; 244c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall 254c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall template <class T> class SmallVectorImpl; 2693d557bc1867b7d7b102f87290194b4be7932c92John McCall} 2793d557bc1867b7d7b102f87290194b4be7932c92John McCall 283a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davisnamespace clang { 293023def6bea3af6dbb51eea51f8cb8ea892d26cfJohn McCall class CastExpr; 304c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall class CXXConstructorDecl; 314c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall class CXXDestructorDecl; 32875ab10245d3bf37252dd822aa1616bb0a391095John McCall class CXXMethodDecl; 33cf2c85e76fdafe7e634810a292321a6c8322483dJohn McCall class CXXRecordDecl; 340bab0cdab751248ca389a5592bcb70eac5d39260John McCall class FieldDecl; 3593d557bc1867b7d7b102f87290194b4be7932c92John McCall class MangleContext; 363a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis 3793d557bc1867b7d7b102f87290194b4be7932c92John McCallnamespace CodeGen { 383a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis class CodeGenFunction; 393a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis class CodeGenModule; 403a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis 413a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis/// Implements C++ ABI-specific code generation functions. 42071cc7deffad608165b1ddd5263e8bf181861520Charles Davisclass CGCXXABI { 43d608cdb7c044365cf4e8764ade1e11e99c176078John McCallprotected: 44d608cdb7c044365cf4e8764ade1e11e99c176078John McCall CodeGenModule &CGM; 45d608cdb7c044365cf4e8764ade1e11e99c176078John McCall llvm::OwningPtr<MangleContext> MangleCtx; 46d608cdb7c044365cf4e8764ade1e11e99c176078John McCall 47d608cdb7c044365cf4e8764ade1e11e99c176078John McCall CGCXXABI(CodeGenModule &CGM) 484c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall : CGM(CGM), MangleCtx(CGM.getContext().createMangleContext()) {} 494c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall 504c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCallprotected: 514c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall ImplicitParamDecl *&getThisDecl(CodeGenFunction &CGF) { 524c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall return CGF.CXXThisDecl; 534c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall } 544c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall llvm::Value *&getThisValue(CodeGenFunction &CGF) { 554c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall return CGF.CXXThisValue; 564c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall } 574c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall 584c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall ImplicitParamDecl *&getVTTDecl(CodeGenFunction &CGF) { 594c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall return CGF.CXXVTTDecl; 604c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall } 614c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall llvm::Value *&getVTTValue(CodeGenFunction &CGF) { 624c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall return CGF.CXXVTTValue; 634c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall } 644c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall 654c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// Build a parameter variable suitable for 'this'. 664c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall void BuildThisParam(CodeGenFunction &CGF, FunctionArgList &Params); 674c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall 684c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// Perform prolog initialization of the parameter variable suitable 694c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// for 'this' emitted by BuildThisParam. 701e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall void EmitThisParam(CodeGenFunction &CGF); 711e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall 723a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis ASTContext &getContext() const { return CGM.getContext(); } 73d608cdb7c044365cf4e8764ade1e11e99c176078John McCall 74071cc7deffad608165b1ddd5263e8bf181861520Charles Davispublic: 753a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis 763a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis virtual ~CGCXXABI(); 773a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis 7893d557bc1867b7d7b102f87290194b4be7932c92John McCall /// Gets the mangle context. 790bab0cdab751248ca389a5592bcb70eac5d39260John McCall MangleContext &getMangleContext() { 800bab0cdab751248ca389a5592bcb70eac5d39260John McCall return *MangleCtx; 810bab0cdab751248ca389a5592bcb70eac5d39260John McCall } 820bab0cdab751248ca389a5592bcb70eac5d39260John McCall 830bab0cdab751248ca389a5592bcb70eac5d39260John McCall /// Find the LLVM type used to represent the given member pointer 840bab0cdab751248ca389a5592bcb70eac5d39260John McCall /// type. 850bab0cdab751248ca389a5592bcb70eac5d39260John McCall virtual const llvm::Type * 860bab0cdab751248ca389a5592bcb70eac5d39260John McCall ConvertMemberPointerType(const MemberPointerType *MPT); 8793d557bc1867b7d7b102f87290194b4be7932c92John McCall 8893d557bc1867b7d7b102f87290194b4be7932c92John McCall /// Load a member function from an object and a member function 8993d557bc1867b7d7b102f87290194b4be7932c92John McCall /// pointer. Apply the this-adjustment and set 'This' to the 9093d557bc1867b7d7b102f87290194b4be7932c92John McCall /// adjusted value. 9193d557bc1867b7d7b102f87290194b4be7932c92John McCall virtual llvm::Value * 923023def6bea3af6dbb51eea51f8cb8ea892d26cfJohn McCall EmitLoadOfMemberFunctionPointer(CodeGenFunction &CGF, 936c2ab1d578c6cc1f3ddcc948532cd625f1092ef2John McCall llvm::Value *&This, 946c2ab1d578c6cc1f3ddcc948532cd625f1092ef2John McCall llvm::Value *MemPtr, 956c2ab1d578c6cc1f3ddcc948532cd625f1092ef2John McCall const MemberPointerType *MPT); 966c2ab1d578c6cc1f3ddcc948532cd625f1092ef2John McCall 976c2ab1d578c6cc1f3ddcc948532cd625f1092ef2John McCall /// Calculate an l-value from an object and a data member pointer. 986c2ab1d578c6cc1f3ddcc948532cd625f1092ef2John McCall virtual llvm::Value *EmitMemberDataPointerAddress(CodeGenFunction &CGF, 990bab0cdab751248ca389a5592bcb70eac5d39260John McCall llvm::Value *Base, 1000bab0cdab751248ca389a5592bcb70eac5d39260John McCall llvm::Value *MemPtr, 1010bab0cdab751248ca389a5592bcb70eac5d39260John McCall const MemberPointerType *MPT); 1020bab0cdab751248ca389a5592bcb70eac5d39260John McCall 1030bab0cdab751248ca389a5592bcb70eac5d39260John McCall /// Perform a derived-to-base or base-to-derived member pointer 104d608cdb7c044365cf4e8764ade1e11e99c176078John McCall /// conversion. 1050bab0cdab751248ca389a5592bcb70eac5d39260John McCall virtual llvm::Value *EmitMemberPointerConversion(CodeGenFunction &CGF, 1060bab0cdab751248ca389a5592bcb70eac5d39260John McCall const CastExpr *E, 1070bab0cdab751248ca389a5592bcb70eac5d39260John McCall llvm::Value *Src); 1080bab0cdab751248ca389a5592bcb70eac5d39260John McCall 109cf2c85e76fdafe7e634810a292321a6c8322483dJohn McCall /// Perform a derived-to-base or base-to-derived member pointer 1100bab0cdab751248ca389a5592bcb70eac5d39260John McCall /// conversion on a constant member pointer. 1110bab0cdab751248ca389a5592bcb70eac5d39260John McCall virtual llvm::Constant *EmitMemberPointerConversion(llvm::Constant *C, 112f16aa103d3afd42fbca2ab346f191bf745cec092John McCall const CastExpr *E); 113cf2c85e76fdafe7e634810a292321a6c8322483dJohn McCall 1140bab0cdab751248ca389a5592bcb70eac5d39260John McCall /// Return true if the given member pointer can be zero-initialized 1150bab0cdab751248ca389a5592bcb70eac5d39260John McCall /// (in the C++ sense) with an LLVM zeroinitializer. 116cf2c85e76fdafe7e634810a292321a6c8322483dJohn McCall virtual bool isZeroInitializable(const MemberPointerType *MPT); 1170bab0cdab751248ca389a5592bcb70eac5d39260John McCall 1180bab0cdab751248ca389a5592bcb70eac5d39260John McCall /// Create a null member pointer of the given type. 119875ab10245d3bf37252dd822aa1616bb0a391095John McCall virtual llvm::Constant *EmitNullMemberPointer(const MemberPointerType *MPT); 1200bab0cdab751248ca389a5592bcb70eac5d39260John McCall 1210bab0cdab751248ca389a5592bcb70eac5d39260John McCall /// Create a member pointer for the given method. 122e9fd7eb6c67676dc27e84eac429aec4f3be51f26John McCall virtual llvm::Constant *EmitMemberPointer(const CXXMethodDecl *MD); 1230bab0cdab751248ca389a5592bcb70eac5d39260John McCall 124e9fd7eb6c67676dc27e84eac429aec4f3be51f26John McCall /// Create a member pointer for the given field. 1250bab0cdab751248ca389a5592bcb70eac5d39260John McCall virtual llvm::Constant *EmitMemberPointer(const FieldDecl *FD); 1260bab0cdab751248ca389a5592bcb70eac5d39260John McCall 1270bab0cdab751248ca389a5592bcb70eac5d39260John McCall /// Emit a comparison between two member pointers. Returns an i1. 1280bab0cdab751248ca389a5592bcb70eac5d39260John McCall virtual llvm::Value * 1290bab0cdab751248ca389a5592bcb70eac5d39260John McCall EmitMemberPointerComparison(CodeGenFunction &CGF, 130e9fd7eb6c67676dc27e84eac429aec4f3be51f26John McCall llvm::Value *L, 1310bab0cdab751248ca389a5592bcb70eac5d39260John McCall llvm::Value *R, 132e9fd7eb6c67676dc27e84eac429aec4f3be51f26John McCall const MemberPointerType *MPT, 1330bab0cdab751248ca389a5592bcb70eac5d39260John McCall bool Inequality); 1340bab0cdab751248ca389a5592bcb70eac5d39260John McCall 1350bab0cdab751248ca389a5592bcb70eac5d39260John McCall /// Determine if a member pointer is non-null. Returns an i1. 1364c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall virtual llvm::Value * 1374c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall EmitMemberPointerIsNotNull(CodeGenFunction &CGF, 1384c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall llvm::Value *MemPtr, 1394c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall const MemberPointerType *MPT); 1404c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall 1414c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// Build the signature of the given constructor variant by adding 1424c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// any required parameters. For convenience, ResTy has been 1434c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// initialized to 'void', and ArgTys has been initialized with the 1444c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// type of 'this' (although this may be changed by the ABI) and 1454c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// will have the formal parameters added to it afterwards. 1464c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// 1474c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// If there are ever any ABIs where the implicit parameters are 1484c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// intermixed with the formal parameters, we can address those 1494c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// then. 1504c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall virtual void BuildConstructorSignature(const CXXConstructorDecl *Ctor, 1514c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall CXXCtorType T, 1524c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall CanQualType &ResTy, 1534c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall llvm::SmallVectorImpl<CanQualType> &ArgTys) = 0; 1544c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall 1554c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// Build the signature of the given destructor variant by adding 1564c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// any required parameters. For convenience, ResTy has been 1574c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// initialized to 'void' and ArgTys has been initialized with the 1584c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// type of 'this' (although this may be changed by the ABI). 1594c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall virtual void BuildDestructorSignature(const CXXDestructorDecl *Dtor, 1604c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall CXXDtorType T, 1614c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall CanQualType &ResTy, 1624c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall llvm::SmallVectorImpl<CanQualType> &ArgTys) = 0; 1634c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall 1644c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// Build the ABI-specific portion of the parameter list for a 1654c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// function. This generally involves a 'this' parameter and 1664c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// possibly some extra data for constructors and destructors. 1674c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// 1684c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// ABIs may also choose to override the return type, which has been 1694c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// initialized with the formal return type of the function. 1704c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall virtual void BuildInstanceFunctionParams(CodeGenFunction &CGF, 1714c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall QualType &ResTy, 1724c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall FunctionArgList &Params) = 0; 1734c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall 1744c40d98ab7acf5f27fa89b17bd8fc0ef7683df37John McCall /// Emit the ABI-specific prolog for the function. 1751e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall virtual void EmitInstanceFunctionProlog(CodeGenFunction &CGF) = 0; 1761e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall 1771e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall virtual void EmitReturnFromThunk(CodeGenFunction &CGF, 1781e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall RValue RV, QualType ResultType); 1791e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall 1801e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /**************************** Array cookies ******************************/ 1811e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall 1821e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// Returns the extra size required in order to store the array 1831e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// cookie for the given type. May return 0 to indicate that no 1841e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// array cookie is required. 1851e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// 1861e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// Several cases are filtered out before this method is called: 1871e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// - non-array allocations never need a cookie 1881e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// - calls to ::operator new(size_t, void*) never need a cookie 1891e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// 1901e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// \param ElementType - the allocated type of the expression, 1911e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// i.e. the pointee type of the expression result type 1921e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall virtual CharUnits GetArrayCookieSize(const CXXNewExpr *expr); 1931e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall 1941e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// Initialize the array cookie for the given allocation. 1951e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// 1961e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// \param NewPtr - a char* which is the presumed-non-null 1971e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// return value of the allocation function 1981e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// \param NumElements - the computed number of elements, 1991e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// potentially collapsed from the multidimensional array case 2001e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// \param ElementType - the base element allocated type, 2011e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// i.e. the allocated type after stripping all array types 2021e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall virtual llvm::Value *InitializeArrayCookie(CodeGenFunction &CGF, 2031e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall llvm::Value *NewPtr, 2041e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall llvm::Value *NumElements, 2051e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall const CXXNewExpr *expr, 2061e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall QualType ElementType); 2071e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall 2081e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// Reads the array cookie associated with the given pointer, 2091e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// if it has one. 2101e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// 2111e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// \param Ptr - a pointer to the first element in the array 2121e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// \param ElementType - the base element type of elements of the array 2131e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// \param NumElements - an out parameter which will be initialized 2141e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// with the number of elements allocated, or zero if there is no 2151e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// cookie 2161e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// \param AllocPtr - an out parameter which will be initialized 2171e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// with a char* pointing to the address returned by the allocation 2181e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// function 2191e7fe751466ea82665fd21e9162fd7cc9c5f412dJohn McCall /// \param CookieSize - an out parameter which will be initialized 2203a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis /// with the size of the cookie, or zero if there is no cookie 2213a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis virtual void ReadArrayCookie(CodeGenFunction &CGF, llvm::Value *Ptr, 2223a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis const CXXDeleteExpr *expr, 223ee79a4c30e5d1c5285551c9a25b8ec6d45d46aa7John McCall QualType ElementType, llvm::Value *&NumElements, 224071cc7deffad608165b1ddd5263e8bf181861520Charles Davis llvm::Value *&AllocPtr, CharUnits &CookieSize); 225071cc7deffad608165b1ddd5263e8bf181861520Charles Davis 22693d557bc1867b7d7b102f87290194b4be7932c92John McCall /*************************** Static local guards ****************************/ 2273a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis 2283a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis /// Emits the guarded initializer and destructor setup for the given 2293a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis /// variable, given that it couldn't be emitted as a constant. 2303a811f1f4286ee3fd0c563c1cfe623956f3caa24Charles Davis /// 231 /// The variable may be: 232 /// - a static local variable 233 /// - a static data member of a class template instantiation 234 virtual void EmitGuardedInit(CodeGenFunction &CGF, const VarDecl &D, 235 llvm::GlobalVariable *DeclPtr); 236 237}; 238 239/// Creates an instance of a C++ ABI class. 240CGCXXABI *CreateARMCXXABI(CodeGenModule &CGM); 241CGCXXABI *CreateItaniumCXXABI(CodeGenModule &CGM); 242CGCXXABI *CreateMicrosoftCXXABI(CodeGenModule &CGM); 243 244} 245} 246 247#endif 248