clang API Documentation

Functions
CGExprCXX.cpp File Reference
#include "CodeGenFunction.h"
#include "CGCUDARuntime.h"
#include "CGCXXABI.h"
#include "CGDebugInfo.h"
#include "CGObjCRuntime.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 RequiredArgs commonEmitCXXMemberOrOperatorCall (CodeGenFunction &CGF, const CXXMethodDecl *MD, llvm::Value *Callee, ReturnValueSlot ReturnValue, llvm::Value *This, llvm::Value *ImplicitParam, QualType ImplicitParamTy, const CallExpr *CE, CallArgList &Args)
static CXXRecordDecl * getCXXRecord (const Expr *E)
static void EmitNullBaseClassInitialization (CodeGenFunction &CGF, llvm::Value *DestPtr, const CXXRecordDecl *Base)
static CharUnits CalculateCookiePadding (CodeGenFunction &CGF, const CXXNewExpr *E)
static llvm::Value * EmitCXXNewAllocSize (CodeGenFunction &CGF, const CXXNewExpr *e, unsigned minElements, llvm::Value *&numElements, llvm::Value *&sizeWithoutCookie)
static void StoreAnyExprIntoOneUnit (CodeGenFunction &CGF, const Expr *Init, QualType AllocType, llvm::Value *NewPtr)
static void EmitNewInitializer (CodeGenFunction &CGF, const CXXNewExpr *E, QualType ElementType, llvm::Value *NewPtr, llvm::Value *NumElements, llvm::Value *AllocSizeWithoutCookie)
static RValue EmitNewDeleteCall (CodeGenFunction &CGF, const FunctionDecl *Callee, const FunctionProtoType *CalleeType, const CallArgList &Args)
static void EnterNewDeleteCleanup (CodeGenFunction &CGF, const CXXNewExpr *E, llvm::Value *NewPtr, llvm::Value *AllocSize, const CallArgList &NewArgs)
static void EmitObjectDelete (CodeGenFunction &CGF, const CXXDeleteExpr *DE, llvm::Value *Ptr, QualType ElementType)
 Emit the code for deleting a single object.
static void EmitArrayDelete (CodeGenFunction &CGF, const CXXDeleteExpr *E, llvm::Value *deletedPtr, QualType elementType)
 Emit the code for deleting an array of objects.
static bool isGLValueFromPointerDeref (const Expr *E)
static llvm::Value * EmitTypeidFromVTable (CodeGenFunction &CGF, const Expr *E, llvm::Type *StdTypeInfoPtrTy)
static llvm::Value * EmitDynamicCastToNull (CodeGenFunction &CGF, QualType DestTy)

Function Documentation

static CharUnits CalculateCookiePadding ( CodeGenFunction &  CGF,
const CXXNewExpr *  E 
) [static]
static RequiredArgs commonEmitCXXMemberOrOperatorCall ( CodeGenFunction &  CGF,
const CXXMethodDecl *  MD,
llvm::Value *  Callee,
ReturnValueSlot  ReturnValue,
llvm::Value *  This,
llvm::Value *  ImplicitParam,
QualType  ImplicitParamTy,
const CallExpr *  CE,
CallArgList &  Args 
) [static]
static void EmitArrayDelete ( CodeGenFunction &  CGF,
const CXXDeleteExpr *  E,
llvm::Value *  deletedPtr,
QualType  elementType 
) [static]
static llvm::Value* EmitCXXNewAllocSize ( CodeGenFunction &  CGF,
const CXXNewExpr *  e,
unsigned  minElements,
llvm::Value *&  numElements,
llvm::Value *&  sizeWithoutCookie 
) [static]
static llvm::Value* EmitDynamicCastToNull ( CodeGenFunction &  CGF,
QualType  DestTy 
) [static]
static RValue EmitNewDeleteCall ( CodeGenFunction &  CGF,
const FunctionDecl *  Callee,
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 1024 of file CGExprCXX.cpp.

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

Referenced by clang::CodeGen::CodeGenFunction::EmitBuiltinNewDeleteCall(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), and clang::CodeGen::CodeGenFunction::EmitDeleteCall().

static void EmitNewInitializer ( CodeGenFunction &  CGF,
const CXXNewExpr *  E,
QualType  ElementType,
llvm::Value *  NewPtr,
llvm::Value *  NumElements,
llvm::Value *  AllocSizeWithoutCookie 
) [static]
static void EmitNullBaseClassInitialization ( CodeGenFunction &  CGF,
llvm::Value *  DestPtr,
const CXXRecordDecl *  Base 
) [static]
static void EmitObjectDelete ( CodeGenFunction &  CGF,
const CXXDeleteExpr *  DE,
llvm::Value *  Ptr,
QualType  ElementType 
) [static]
static llvm::Value* EmitTypeidFromVTable ( CodeGenFunction &  CGF,
const Expr *  E,
llvm::Type *  StdTypeInfoPtrTy 
) [static]
static void EnterNewDeleteCleanup ( CodeGenFunction &  CGF,
const CXXNewExpr *  E,
llvm::Value *  NewPtr,
llvm::Value *  AllocSize,
const CallArgList &  NewArgs 
) [static]
static CXXRecordDecl* getCXXRecord ( const Expr *  E) [static]
static bool isGLValueFromPointerDeref ( const Expr *  E) [static]

Definition at line 1628 of file CGExprCXX.cpp.

References clang::BO_Comma, clang::Expr::IgnoreParens(), and clang::UO_Deref.

Referenced by EmitTypeidFromVTable().

static void StoreAnyExprIntoOneUnit ( CodeGenFunction &  CGF,
const Expr *  Init,
QualType  AllocType,
llvm::Value *  NewPtr 
) [static]