clang
7.0.0
|
#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"
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 CXXRecordDecl * | getCXXRecord (const Expr *E) |
static void | EmitNullBaseClassInitialization (CodeGenFunction &CGF, Address 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, Address NewPtr, AggValueSlot::Overlap_t MayOverlap) |
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::Value * | EmitTypeidFromVTable (CodeGenFunction &CGF, const Expr *E, llvm::Type *StdTypeInfoPtrTy) |
static llvm::Value * | EmitDynamicCastToNull (CodeGenFunction &CGF, QualType DestTy) |
|
static |
Definition at line 665 of file CGExprCXX.cpp.
Referenced by EmitCXXNewAllocSize().
|
static |
Definition at line 37 of file CGExprCXX.cpp.
References clang::CodeGen::CallArgList::add(), clang::CodeGen::CallArgList::addFrom(), clang::CallExpr::arguments(), clang::Type::castAs(), clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitCallArgs(), clang::CodeGen::RequiredArgs::forPrototypePlus(), clang::CodeGen::RValue::get(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::CallExpr::getDirectCallee(), clang::FunctionProtoType::getNumParams(), clang::CodeGen::CGCXXABI::getThisArgumentTypeForMethod(), clang::ValueDecl::getType(), and clang::CXXMethodDecl::isInstance().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXDestructorCall(), and clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorCall().
|
static |
Emit the code for deleting an array of objects.
Definition at line 1951 of file CGExprCXX.cpp.
|
static |
Definition at line 678 of file CGExprCXX.cpp.
References clang::CodeGen::CodeGenFunction::Builder, CalculateCookiePadding(), clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CXXNewExpr::getAllocatedType(), clang::CXXNewExpr::getArraySize(), clang::ASTContext::getAsConstantArrayType(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenModule::getIntrinsic(), clang::CharUnits::getQuantity(), clang::Expr::getType(), clang::ASTContext::getTypeSizeInChars(), clang::CXXNewExpr::isArray(), clang::CharUnits::isOne(), clang::Type::isSignedIntegerOrEnumerationType(), clang::CodeGen::CodeGenTypeCache::SizeTy, and clang::CodeGen::ConstantEmitter::tryEmitAbstract().
|
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 1850 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().
|
static |
C++ [expr.dynamic.cast]p9: A failed cast to reference type throws std::bad_cast
Definition at line 2148 of file CGExprCXX.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::ConvertType(), clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CGCXXABI::EmitBadCastCall(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::Type::isPointerType(), and clang::CodeGen::Type.
Referenced by clang::CodeGen::CodeGenFunction::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 1290 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().
|
static |
Definition at line 1275 of file CGExprCXX.cpp.
|
static |
Definition at line 481 of file CGExprCXX.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CGBuilderTy::CreateConstInBoundsByteGEP(), clang::CodeGen::CGBuilderTy::CreateElementBitCast(), clang::CodeGen::CGBuilderTy::CreateMemCpy(), clang::CodeGen::CGBuilderTy::CreateMemSet(), clang::CodeGen::CodeGenFunction::EmitCastToVoidPtr(), clang::CodeGen::CodeGenModule::EmitNullConstantForBase(), clang::CodeGen::Address::getAlignment(), clang::ASTContext::getASTRecordLayout(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::CodeGen::CodeGenModule::getModule(), clang::ASTRecordLayout::getNonVirtualAlignment(), clang::ASTRecordLayout::getNonVirtualSize(), clang::CodeGen::CodeGenTypeCache::getPointerSize(), clang::CodeGen::CodeGenModule::getSize(), clang::CodeGen::CGCXXABI::getVBPtrOffsets(), clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::CXXRecordDecl::isEmpty(), clang::CharUnits::isNegative(), clang::CharUnits::isZero(), max(), and clang::CharUnits::Zero().
|
static |
Emit the code for deleting a single object.
Definition at line 1862 of file CGExprCXX.cpp.
References clang::CodeGen::ARCPreciseLifetime, clang::CodeGen::CodeGenFunction::CGM, clang::Dtor_Complete, clang::CodeGen::CodeGenFunction::EHStack, clang::CodeGen::CodeGenFunction::EmitARCDestroyStrong(), clang::CodeGen::CodeGenFunction::EmitARCDestroyWeak(), clang::CodeGen::CodeGenFunction::EmitCXXDestructorCall(), clang::CodeGen::CodeGenFunction::EmitDeleteCall(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), clang::CodeGen::CGCXXABI::emitVirtualObjectDelete(), clang::Type::getAs(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::CXXRecordDecl::getDestructor(), clang::Expr::getExprLoc(), clang::QualType::getObjCLifetime(), clang::CXXDeleteExpr::getOperatorDelete(), clang::CodeGen::Address::getPointer(), clang::CXXRecordDecl::hasDefinition(), clang::CXXRecordDecl::hasTrivialDestructor(), clang::FunctionDecl::isDestroyingOperatorDelete(), clang::CodeGen::NormalAndEHCleanup, clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, clang::CodeGen::CodeGenFunction::PopCleanupBlock(), and clang::CodeGen::CodeGenFunction::TCK_MemberCall.
|
static |
Definition at line 2084 of file CGExprCXX.cpp.
|
static |
Enter a cleanup to call 'operator delete' if the initializer in a new-expression throws.
Definition at line 1478 of file CGExprCXX.cpp.
|
static |
Definition at line 158 of file CGExprCXX.cpp.
|
static |
Definition at line 1350 of file CGExprCXX.cpp.
References clang::Type::castAs(), clang::ValueDecl::getType(), clang::Type::isAlignValT(), clang::FunctionDecl::isDestroyingOperatorDelete(), clang::Type::isIntegerType(), clang::FunctionProtoType::param_type_begin(), and clang::FunctionProtoType::param_type_end().
Referenced by clang::CodeGen::CodeGenFunction::EmitDeleteCall().
Definition at line 2052 of file CGExprCXX.cpp.
|
static |
Definition at line 940 of file CGExprCXX.cpp.
References clang::CodeGen::AggValueSlot::DoesNotNeedGCBarriers, clang::CodeGen::CodeGenFunction::EmitAggExpr(), clang::CodeGen::CodeGenFunction::EmitComplexExprIntoLValue(), clang::CodeGen::CodeGenFunction::EmitScalarInit(), clang::CodeGen::AggValueSlot::forAddr(), clang::CodeGen::CodeGenFunction::getEvaluationKind(), clang::QualType::getQualifiers(), clang::CodeGen::AggValueSlot::IsDestructed, clang::CodeGen::AggValueSlot::IsNotAliased, clang::CodeGen::AggValueSlot::IsNotZeroed, clang::CodeGen::AggValueSlot::IsSanitizerChecked, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::CodeGen::TEK_Aggregate, clang::CodeGen::TEK_Complex, and clang::CodeGen::TEK_Scalar.