clang  6.0.0svn
Functions
CGExprCXX.cpp File Reference
#include "CodeGenFunction.h"
#include "CGCUDARuntime.h"
#include "CGCXXABI.h"
#include "CGDebugInfo.h"
#include "CGObjCRuntime.h"
#include "ConstantEmitter.h"
#include "clang/CodeGen/CGFunctionInfo.h"
#include "clang/Frontend/CodeGenOptions.h"
#include "llvm/IR/CallSite.h"
#include "llvm/IR/Intrinsics.h"
Include dependency graph for CGExprCXX.cpp:

Go to the source code of this file.

Functions

static MemberCallInfo commonEmitCXXMemberOrOperatorCall (CodeGenFunction &CGF, const CXXMethodDecl *MD, llvm::Value *This, llvm::Value *ImplicitParam, QualType ImplicitParamTy, const CallExpr *CE, CallArgList &Args, CallArgList *RtlArgs)
 
static CXXRecordDeclgetCXXRecord (const Expr *E)
 
static void EmitNullBaseClassInitialization (CodeGenFunction &CGF, Address DestPtr, const CXXRecordDecl *Base)
 
static CharUnits CalculateCookiePadding (CodeGenFunction &CGF, const CXXNewExpr *E)
 
static llvm::ValueEmitCXXNewAllocSize (CodeGenFunction &CGF, const CXXNewExpr *e, unsigned minElements, llvm::Value *&numElements, llvm::Value *&sizeWithoutCookie)
 
static void StoreAnyExprIntoOneUnit (CodeGenFunction &CGF, const Expr *Init, QualType AllocType, Address NewPtr)
 
static void EmitNewInitializer (CodeGenFunction &CGF, const CXXNewExpr *E, QualType ElementType, llvm::Type *ElementTy, Address NewPtr, llvm::Value *NumElements, llvm::Value *AllocSizeWithoutCookie)
 
static RValue EmitNewDeleteCall (CodeGenFunction &CGF, const FunctionDecl *CalleeDecl, const FunctionProtoType *CalleeType, const CallArgList &Args)
 Emit a call to an operator new or operator delete function, as implicitly created by new-expressions and delete-expressions. More...
 
static UsualDeleteParams getUsualDeleteParams (const FunctionDecl *FD)
 
static void EnterNewDeleteCleanup (CodeGenFunction &CGF, const CXXNewExpr *E, Address NewPtr, llvm::Value *AllocSize, CharUnits AllocAlign, const CallArgList &NewArgs)
 Enter a cleanup to call 'operator delete' if the initializer in a new-expression throws. More...
 
static void EmitDestroyingObjectDelete (CodeGenFunction &CGF, const CXXDeleteExpr *DE, Address Ptr, QualType ElementType)
 Emit the code for deleting a single object with a destroying operator delete. More...
 
static void EmitObjectDelete (CodeGenFunction &CGF, const CXXDeleteExpr *DE, Address Ptr, QualType ElementType)
 Emit the code for deleting a single object. More...
 
static void EmitArrayDelete (CodeGenFunction &CGF, const CXXDeleteExpr *E, Address deletedPtr, QualType elementType)
 Emit the code for deleting an array of objects. More...
 
static bool isGLValueFromPointerDeref (const Expr *E)
 
static llvm::ValueEmitTypeidFromVTable (CodeGenFunction &CGF, const Expr *E, llvm::Type *StdTypeInfoPtrTy)
 
static llvm::ValueEmitDynamicCastToNull (CodeGenFunction &CGF, QualType DestTy)
 

Function Documentation

◆ CalculateCookiePadding()

static CharUnits CalculateCookiePadding ( CodeGenFunction CGF,
const CXXNewExpr E 
)
static

Definition at line 650 of file CGExprCXX.cpp.

Referenced by EmitCXXNewAllocSize().

◆ commonEmitCXXMemberOrOperatorCall()

static MemberCallInfo commonEmitCXXMemberOrOperatorCall ( CodeGenFunction CGF,
const CXXMethodDecl MD,
llvm::Value This,
llvm::Value ImplicitParam,
QualType  ImplicitParamTy,
const CallExpr CE,
CallArgList Args,
CallArgList RtlArgs 
)
static

◆ EmitArrayDelete()

static void EmitArrayDelete ( CodeGenFunction CGF,
const CXXDeleteExpr E,
Address  deletedPtr,
QualType  elementType 
)
static

Emit the code for deleting an array of objects.

Definition at line 1920 of file CGExprCXX.cpp.

◆ EmitCXXNewAllocSize()

static llvm::Value* EmitCXXNewAllocSize ( CodeGenFunction CGF,
const CXXNewExpr e,
unsigned  minElements,
llvm::Value *&  numElements,
llvm::Value *&  sizeWithoutCookie 
)
static

◆ EmitDestroyingObjectDelete()

static void EmitDestroyingObjectDelete ( CodeGenFunction CGF,
const CXXDeleteExpr DE,
Address  Ptr,
QualType  ElementType 
)
static

Emit the code for deleting a single object with a destroying operator delete.

If the element type has a non-virtual destructor, Ptr has already been converted to the type of the parameter of 'operator delete'. Otherwise Ptr points to an object of the static type.

Definition at line 1819 of file CGExprCXX.cpp.

References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitDeleteCall(), clang::CodeGen::CGCXXABI::emitVirtualObjectDelete(), clang::Type::getAsCXXRecordDecl(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::CXXRecordDecl::getDestructor(), clang::CXXDeleteExpr::getOperatorDelete(), and clang::CodeGen::Address::getPointer().

◆ EmitDynamicCastToNull()

static llvm::Value* EmitDynamicCastToNull ( CodeGenFunction CGF,
QualType  DestTy 
)
static

◆ EmitNewDeleteCall()

static RValue EmitNewDeleteCall ( CodeGenFunction CGF,
const FunctionDecl CalleeDecl,
const FunctionProtoType CalleeType,
const CallArgList Args 
)
static

Emit a call to an operator new or operator delete function, as implicitly created by new-expressions and delete-expressions.

C++1y [expr.new]p10: [In a new-expression,] an implementation is allowed to omit a call to a replaceable global allocation function.

We model such elidable calls with the 'builtin' attribute.

Definition at line 1265 of file CGExprCXX.cpp.

References clang::CodeGen::CodeGenTypes::arrangeFreeFunctionCall(), clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitCall(), clang::CodeGen::CGCallee::forDirect(), clang::CodeGen::CodeGenModule::GetAddrOfFunction(), clang::CodeGen::CodeGenModule::getTypes(), and clang::FunctionDecl::isReplaceableGlobalAllocationFunction().

◆ EmitNewInitializer()

static void EmitNewInitializer ( CodeGenFunction CGF,
const CXXNewExpr E,
QualType  ElementType,
llvm::Type *  ElementTy,
Address  NewPtr,
llvm::Value NumElements,
llvm::Value AllocSizeWithoutCookie 
)
static

Definition at line 1251 of file CGExprCXX.cpp.

◆ EmitNullBaseClassInitialization()

static void EmitNullBaseClassInitialization ( CodeGenFunction CGF,
Address  DestPtr,
const CXXRecordDecl Base 
)
static

◆ EmitObjectDelete()

static void EmitObjectDelete ( CodeGenFunction CGF,
const CXXDeleteExpr DE,
Address  Ptr,
QualType  ElementType 
)
static

◆ EmitTypeidFromVTable()

static llvm::Value* EmitTypeidFromVTable ( CodeGenFunction CGF,
const Expr E,
llvm::Type *  StdTypeInfoPtrTy 
)
static

Definition at line 2053 of file CGExprCXX.cpp.

◆ EnterNewDeleteCleanup()

static void EnterNewDeleteCleanup ( CodeGenFunction CGF,
const CXXNewExpr E,
Address  NewPtr,
llvm::Value AllocSize,
CharUnits  AllocAlign,
const CallArgList NewArgs 
)
static

Enter a cleanup to call 'operator delete' if the initializer in a new-expression throws.

Definition at line 1453 of file CGExprCXX.cpp.

◆ getCXXRecord()

static CXXRecordDecl* getCXXRecord ( const Expr E)
static

◆ getUsualDeleteParams()

static UsualDeleteParams getUsualDeleteParams ( const FunctionDecl FD)
static

◆ isGLValueFromPointerDeref()

static bool isGLValueFromPointerDeref ( const Expr E)
static

Definition at line 2021 of file CGExprCXX.cpp.

◆ StoreAnyExprIntoOneUnit()

static void StoreAnyExprIntoOneUnit ( CodeGenFunction CGF,
const Expr Init,
QualType  AllocType,
Address  NewPtr 
)
static