clang 23.0.0git
CIRGenExprCXX.cpp File Reference
#include "CIRGenCXXABI.h"
#include "CIRGenConstantEmitter.h"
#include "CIRGenFunction.h"
#include "clang/AST/CharUnits.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprObjC.h"
#include "clang/Basic/OperatorKinds.h"
#include "clang/CIR/MissingFeatures.h"
#include "llvm/ADT/Sequence.h"
#include "llvm/Support/TrailingObjects.h"

Go to the source code of this file.

Functions

static MemberCallInfo commonBuildCXXMemberOrOperatorCall (CIRGenFunction &cgf, const CXXMethodDecl *md, mlir::Value thisPtr, mlir::Value implicitParam, QualType implicitParamTy, const CallExpr *ce, CallArgList &args, CallArgList *rtlArgs)
static void emitNullBaseClassInitialization (CIRGenFunction &cgf, Address destPtr, const CXXRecordDecl *base)
static CharUnits calculateCookiePadding (CIRGenFunction &cgf, const CXXNewExpr *e)
static mlir::Value emitCXXNewAllocSize (CIRGenFunction &cgf, const CXXNewExpr *e, unsigned minElements, mlir::Value &numElements, mlir::Value &sizeWithoutCookie)
static RValue emitNewDeleteCall (CIRGenFunction &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.
static void enterNewDeleteCleanup (CIRGenFunction &cgf, const CXXNewExpr *e, Address newPtr, mlir::Value allocSize, CharUnits allocAlign, const CallArgList &newArgs)
 Enter a cleanup to call 'operator delete' if the initializer in a new-expression throws.
static void storeAnyExprIntoOneUnit (CIRGenFunction &cgf, const Expr *init, QualType allocType, Address newPtr, AggValueSlot::Overlap_t mayOverlap)
static void emitNewInitializer (CIRGenFunction &cgf, const CXXNewExpr *e, QualType elementType, mlir::Type elementTy, Address newPtr, mlir::Value numElements, mlir::Value allocSizeWithoutCookie)
static void emitDestroyingObjectDelete (CIRGenFunction &cgf, const CXXDeleteExpr *de, Address ptr, QualType elementType)
 Emit the code for deleting a single object via a destroying operator delete.
static void emitObjectDelete (CIRGenFunction &cgf, const CXXDeleteExpr *de, Address ptr, QualType elementType)
 Emit the code for deleting a single object.
static mlir::Value emitDynamicCastToNull (CIRGenFunction &cgf, mlir::Location loc, QualType destTy)
static mlir::Value emitCXXTypeidFromVTable (CIRGenFunction &cgf, const Expr *e, mlir::Type typeInfoPtrTy, bool hasNullCheck)

Function Documentation

◆ calculateCookiePadding()

◆ commonBuildCXXMemberOrOperatorCall()

◆ emitCXXNewAllocSize()

◆ emitCXXTypeidFromVTable()

◆ emitDestroyingObjectDelete()

void emitDestroyingObjectDelete ( CIRGenFunction & cgf,
const CXXDeleteExpr * de,
Address ptr,
QualType elementType )
static

Emit the code for deleting a single object via 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 1404 of file CIRGenExprCXX.cpp.

References clang::CIRGen::CIRGenFunction::cgm, clang::CIRGen::CIRGenFunction::emitDeleteCall(), clang::CIRGen::CIRGenCXXABI::emitVirtualObjectDelete(), clang::Type::getAsCXXRecordDecl(), clang::CIRGen::CIRGenModule::getCXXABI(), clang::CXXRecordDecl::getDestructor(), clang::CXXDeleteExpr::getOperatorDelete(), clang::CIRGen::Address::getPointer(), and clang::CXXMethodDecl::isVirtual().

Referenced by clang::CIRGen::CIRGenFunction::emitCXXDeleteExpr().

◆ emitDynamicCastToNull()

◆ emitNewDeleteCall()

RValue emitNewDeleteCall ( CIRGenFunction & 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 750 of file CIRGenExprCXX.cpp.

References clang::CIRGen::CIRGenTypes::arrangeFreeFunctionCall(), clang::CIRGen::CIRGenFunction::cgm, clang::CIRGen::CIRGenFunction::emitCall(), clang::CIRGen::CIRGenCallee::forDirect(), clang::CIRGen::CIRGenModule::getAddrOfFunction(), clang::CIRGen::CIRGenModule::getTypes(), and clang::FunctionDecl::isReplaceableGlobalAllocationFunction().

Referenced by clang::CIRGen::CIRGenFunction::emitCXXNewExpr(), clang::CIRGen::CIRGenFunction::emitDeleteCall(), and clang::CIRGen::CIRGenFunction::emitNewOrDeleteBuiltinCall().

◆ emitNewInitializer()

◆ emitNullBaseClassInitialization()

◆ emitObjectDelete()

◆ enterNewDeleteCleanup()

◆ storeAnyExprIntoOneUnit()