|
clang 23.0.0git
|
#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) |
|
static |
Definition at line 449 of file CIRGenExprCXX.cpp.
References clang::CIRGen::CIRGenFunction::cgm, clang::CIRGen::CIRGenCXXABI::getArrayCookieSize(), clang::CIRGen::CIRGenModule::getCXXABI(), clang::CXXNewExpr::getOperatorNew(), clang::CXXNewExpr::isArray(), clang::FunctionDecl::isReservedGlobalPlacementOperator(), and clang::CharUnits::Zero().
Referenced by emitCXXNewAllocSize().
|
static |
Definition at line 37 of file CIRGenExprCXX.cpp.
References clang::CIRGen::CallArgList::add(), clang::CIRGen::CallArgList::addFrom(), clang::CallExpr::arguments(), clang::Type::castAs(), clang::CIRGen::CIRGenFunction::cgm, clang::CIRGen::CIRGenTypes::deriveThisType(), clang::CIRGen::CIRGenFunction::emitCallArgs(), clang::CIRGen::RValue::get(), clang::CIRGen::CIRGenModule::getCXXABI(), clang::CallExpr::getDirectCallee(), clang::CIRGen::RequiredArgs::getFromProtoWithExtraSlots(), clang::CIRGen::CIRGenCXXABI::getThisArgumentTypeForMethod(), clang::ValueDecl::getType(), clang::CIRGen::CIRGenFunction::getTypes(), clang::isa(), and clang::CXXMethodDecl::isInstance().
Referenced by clang::CIRGen::CIRGenFunction::emitCXXDestructorCall(), and clang::CIRGen::CIRGenFunction::emitCXXMemberOrOperatorCall().
|
static |
Definition at line 462 of file CIRGenExprCXX.cpp.
References calculateCookiePadding(), clang::CIRGen::CIRGenFunction::cgm, cir::CIRBaseBuilderTy::createCompare(), cir::CIRBaseBuilderTy::createIntCast(), cir::CIRBaseBuilderTy::createMul(), cir::CIRBaseBuilderTy::createOr(), cir::CIRBaseBuilderTy::createSelect(), clang::CIRGen::CIRGenFunction::emitScalarExpr(), clang::CXXNewExpr::getAllocatedType(), clang::CXXNewExpr::getArraySize(), clang::ASTContext::getAsConstantArrayType(), clang::CIRGen::CIRGenFunction::getBuilder(), cir::CIRBaseBuilderTy::getConstant(), clang::CIRGen::CIRGenBuilderTy::getConstInt(), clang::CIRGen::CIRGenFunction::getContext(), clang::CIRGen::CIRGenModule::getDataLayout(), clang::CIRGen::CIRGenFunction::getLoc(), clang::CharUnits::getQuantity(), clang::CIRGen::CIRGenBuilderTy::getSIntNTy(), clang::CXXNewExpr::getSourceRange(), clang::Expr::getType(), cir::CIRDataLayout::getTypeSizeInBits(), clang::ASTContext::getTypeSizeInChars(), clang::CIRGen::CIRGenBuilderTy::getUIntNTy(), clang::CXXNewExpr::isArray(), clang::CharUnits::isOne(), clang::CIRGen::CIRGenTypeCache::sizeTy, clang::CIRGen::ConstantEmitter::tryEmitAbstract(), and clang::ast_matchers::type.
Referenced by clang::CIRGen::CIRGenFunction::emitCXXNewExpr().
|
static |
Definition at line 1888 of file CIRGenExprCXX.cpp.
References clang::CIRGen::CIRGenFunction::cgm, cir::CIRBaseBuilderTy::createPtrIsNull(), clang::CIRGen::CIRGenFunction::emitLValue(), clang::CIRGen::CIRGenCXXABI::emitTypeid(), clang::CIRGen::LValue::getAddress(), clang::CIRGen::CIRGenFunction::getBuilder(), clang::CIRGen::CIRGenModule::getCXXABI(), clang::CIRGen::CIRGenFunction::getLoc(), clang::CIRGen::Address::getPointer(), clang::Stmt::getSourceRange(), clang::Expr::getType(), cir::MissingFeatures::sanitizers(), and clang::CIRGen::CIRGenCXXABI::shouldTypeidBeNullChecked().
Referenced by clang::CIRGen::CIRGenFunction::emitCXXTypeidExpr().
|
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().
|
static |
C++ [expr.dynamic.cast]p9: A failed cast to reference type throws std::bad_cast
Definition at line 1830 of file CIRGenExprCXX.cpp.
References clang::CIRGen::CIRGenFunction::cgm, clang::CIRGen::CIRGenFunction::convertType(), clang::CIRGen::CIRGenCXXABI::emitBadCastCall(), clang::CIRGen::CIRGenFunction::getBuilder(), clang::CIRGen::CIRGenModule::getCXXABI(), cir::CIRBaseBuilderTy::getNullPtr(), and clang::Type::isPointerType().
Referenced by clang::CIRGen::CIRGenFunction::emitDynamicCast().
|
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().
|
static |
Definition at line 1327 of file CIRGenExprCXX.cpp.
References clang::CIRGen::AggValueSlot::DoesNotOverlap, clang::CIRGen::CIRGenFunction::emitNewArrayInitializer(), cir::MissingFeatures::generateDebugInfo(), clang::CXXNewExpr::getAllocatedType(), clang::CXXNewExpr::getInitializer(), clang::CXXNewExpr::isArray(), and storeAnyExprIntoOneUnit().
Referenced by clang::CIRGen::CIRGenFunction::emitCXXNewExpr().
|
static |
Definition at line 328 of file CIRGenExprCXX.cpp.
References clang::CIRGen::CIRGenFunction::cgm, clang::CIRGen::CIRGenBuilderTy::createStore(), clang::CIRGen::CIRGenModule::emitNullConstantForBase(), clang::CIRGen::CIRGenModule::errorNYI(), clang::ASTContext::getASTRecordLayout(), clang::TypeDecl::getBeginLoc(), clang::CIRGen::CIRGenFunction::getBuilder(), cir::CIRBaseBuilderTy::getConstant(), clang::CIRGen::CIRGenFunction::getContext(), clang::CIRGen::CIRGenFunction::getLoc(), clang::ASTRecordLayout::getNonVirtualSize(), clang::TagDecl::getSourceRange(), clang::CXXRecordDecl::isEmpty(), clang::CIRGen::CIRGenBuilderTy::isNullValue(), cir::MissingFeatures::msabi(), and clang::CharUnits::Zero().
Referenced by clang::CIRGen::CIRGenFunction::emitCXXConstructExpr().
|
static |
Emit the code for deleting a single object.
Definition at line 1419 of file CIRGenExprCXX.cpp.
References clang::CIRGen::CIRGenFunction::cgm, cir::MissingFeatures::devirtualizeDestructor(), clang::Dtor_Complete, clang::CIRGen::CIRGenFunction::ehStack, clang::CIRGen::CIRGenFunction::emitCXXDestructorCall(), cir::MissingFeatures::emitTypeCheck(), clang::CIRGen::CIRGenCXXABI::emitVirtualObjectDelete(), clang::CIRGen::CIRGenModule::errorNYI(), clang::Type::getAsCXXRecordDecl(), clang::CIRGen::CIRGenModule::getCXXABI(), clang::QualType::getObjCLifetime(), clang::CXXDeleteExpr::getOperatorDelete(), clang::CIRGen::Address::getPointer(), clang::Stmt::getSourceRange(), clang::FunctionDecl::isDestroyingOperatorDelete(), clang::CXXMethodDecl::isVirtual(), clang::CIRGen::NormalAndEHCleanup, cir::MissingFeatures::objCLifetime(), and clang::CIRGen::CIRGenFunction::popCleanupBlock().
Referenced by clang::CIRGen::CIRGenFunction::emitCXXDeleteExpr().
|
static |
Enter a cleanup to call 'operator delete' if the initializer in a new-expression throws.
Definition at line 917 of file CIRGenExprCXX.cpp.
References clang::CIRGen::CIRGenFunction::cgm, cleanup(), clang::CIRGen::CIRGenBuilderTy::createAlignedLoad(), clang::CIRGen::CIRGenBuilderTy::createStore(), clang::CIRGen::CIRGenFunction::createTempAlloca(), clang::CIRGen::EHCleanup, clang::CIRGen::CIRGenFunction::ehStack, clang::CIRGen::Address::emitRawPointer(), clang::CharUnits::fromQuantity(), clang::CIRGen::RValue::get(), cir::CIRDataLayout::getABITypeAlign(), clang::CIRGen::CIRGenFunction::getBuilder(), clang::CIRGen::CIRGenModule::getDataLayout(), clang::CIRGen::CIRGenFunction::getLoc(), clang::CXXNewExpr::getNumImplicitArgs(), clang::CXXNewExpr::getNumPlacementArgs(), clang::CXXNewExpr::getOperatorDelete(), clang::CIRGen::Address::getPointer(), clang::CXXNewExpr::getSourceRange(), clang::CXXNewExpr::implicitAllocationParameters(), clang::CIRGen::CIRGenFunction::initFullExprCleanup(), clang::CIRGen::CIRGenFunction::isInConditionalBranch(), clang::CIRGen::EHScopeStack::pushCleanupWithExtra(), and cir::MissingFeatures::typeAwareAllocation().
Referenced by clang::CIRGen::CIRGenFunction::emitCXXNewExpr().
|
static |
Definition at line 992 of file CIRGenExprCXX.cpp.
References cir::MissingFeatures::aggValueSlotGC(), clang::CIRGen::CIRGenFunction::emitAggExpr(), clang::CIRGen::CIRGenFunction::emitComplexExprIntoLValue(), clang::CIRGen::CIRGenFunction::emitScalarInit(), clang::CIRGen::AggValueSlot::forAddr(), clang::CIRGen::CIRGenFunction::getEvaluationKind(), clang::CIRGen::CIRGenFunction::getLoc(), clang::QualType::getQualifiers(), clang::Stmt::getSourceRange(), clang::CIRGen::AggValueSlot::IsDestructed, clang::CIRGen::AggValueSlot::IsNotAliased, clang::CIRGen::AggValueSlot::IsNotZeroed, clang::CIRGen::CIRGenFunction::makeAddrLValue(), cir::MissingFeatures::sanitizers(), cir::TEK_Aggregate, cir::TEK_Complex, and cir::TEK_Scalar.
Referenced by clang::CIRGen::CIRGenFunction::emitNewArrayInitializer(), and emitNewInitializer().