clang API Documentation
#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"
Go to the source code of this file.
static CharUnits CalculateCookiePadding | ( | CodeGenFunction & | CGF, |
const CXXNewExpr * | E | ||
) | [static] |
Definition at line 477 of file CGExprCXX.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CGCXXABI::GetArrayCookieSize(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::CXXNewExpr::getOperatorNew(), clang::CXXNewExpr::isArray(), clang::FunctionDecl::isReservedGlobalPlacementOperator(), and clang::CharUnits::Zero().
Referenced by EmitCXXNewAllocSize(), and clang::CodeGen::CodeGenFunction::EmitCXXNewExpr().
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] |
Definition at line 27 of file CGExprCXX.cpp.
References clang::CodeGen::CallArgList::add(), clang::CallExpr::arg_begin(), clang::CallExpr::arg_end(), clang::Type::castAs(), clang::CodeGen::CodeGenFunction::EmitCallArgs(), clang::CodeGen::CodeGenFunction::EmitTypeCheck(), clang::CodeGen::RequiredArgs::forPrototypePlus(), clang::CodeGen::RValue::get(), clang::CodeGen::CodeGenFunction::getContext(), clang::CallExpr::getDirectCallee(), clang::Expr::getExprLoc(), clang::FunctionProtoType::getNumParams(), clang::CXXMethodDecl::getParent(), clang::ASTContext::getRecordType(), clang::CXXMethodDecl::getThisType(), clang::ValueDecl::getType(), clang::CXXMethodDecl::isInstance(), clang::CodeGen::CodeGenFunction::TCK_ConstructorCall, and clang::CodeGen::CodeGenFunction::TCK_MemberCall.
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorCall(), and clang::CodeGen::CodeGenFunction::EmitCXXStructorCall().
static void EmitArrayDelete | ( | CodeGenFunction & | CGF, |
const CXXDeleteExpr * | E, | ||
llvm::Value * | deletedPtr, | ||
QualType | elementType | ||
) | [static] |
Emit the code for deleting an array of objects.
Definition at line 1541 of file CGExprCXX.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EHStack, clang::CodeGen::CodeGenFunction::emitArrayDestroy(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::CodeGen::CodeGenFunction::getDestroyer(), clang::CodeGen::CodeGenFunction::needsEHCleanup(), clang::CodeGen::NormalAndEHCleanup, clang::CodeGen::CodeGenFunction::PopCleanupBlock(), and clang::CodeGen::CGCXXABI::ReadArrayCookie().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXDeleteExpr().
static llvm::Value* EmitCXXNewAllocSize | ( | CodeGenFunction & | CGF, |
const CXXNewExpr * | e, | ||
unsigned | minElements, | ||
llvm::Value *& | numElements, | ||
llvm::Value *& | sizeWithoutCookie | ||
) | [static] |
Definition at line 490 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::ast_matchers::type.
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXNewExpr().
static llvm::Value* EmitDynamicCastToNull | ( | CodeGenFunction & | CGF, |
QualType | DestTy | ||
) | [static] |
C++ [expr.dynamic.cast]p9: A failed cast to reference type throws std::bad_cast
Definition at line 1716 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(), and clang::Type::isPointerType().
Referenced by clang::CodeGen::CodeGenFunction::EmitDynamicCast().
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] |
Definition at line 1010 of file CGExprCXX.cpp.
References clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), clang::CXXNewExpr::getAllocatedType(), clang::CXXNewExpr::getInitializer(), clang::CXXNewExpr::isArray(), and StoreAnyExprIntoOneUnit().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXNewExpr().
static void EmitNullBaseClassInitialization | ( | CodeGenFunction & | CGF, |
llvm::Value * | DestPtr, | ||
const CXXRecordDecl * | Base | ||
) | [static] |
Definition at line 338 of file CGExprCXX.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitCastToVoidPtr(), clang::CodeGen::CodeGenModule::EmitNullConstantForBase(), clang::ASTContext::getASTRecordLayout(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenModule::getModule(), clang::ASTRecordLayout::getNonVirtualAlignment(), clang::ASTRecordLayout::getNonVirtualSize(), clang::CharUnits::getQuantity(), clang::CodeGen::CodeGenModule::getSize(), clang::CodeGen::CodeGenModule::getTypes(), clang::CXXRecordDecl::isEmpty(), and clang::CodeGen::CodeGenTypes::isZeroInitializable().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXConstructExpr().
static void EmitObjectDelete | ( | CodeGenFunction & | CGF, |
const CXXDeleteExpr * | DE, | ||
llvm::Value * | Ptr, | ||
QualType | ElementType | ||
) | [static] |
Emit the code for deleting a single object.
Definition at line 1422 of file CGExprCXX.cpp.
References clang::CodeGen::ARCPreciseLifetime, clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::Dtor_Complete, clang::CodeGen::CodeGenFunction::EHStack, clang::CodeGen::CodeGenFunction::EmitARCDestroyWeak(), clang::CodeGen::CodeGenFunction::EmitARCRelease(), clang::CodeGen::CodeGenFunction::EmitCXXDestructorCall(), clang::CodeGen::CGCXXABI::emitVirtualObjectDelete(), clang::Type::getAs(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::CXXRecordDecl::getDestructor(), clang::CodeGen::CodeGenFunction::getLangOpts(), clang::QualType::getObjCLifetime(), clang::CXXDeleteExpr::getOperatorDelete(), clang::CXXRecordDecl::hasDefinition(), clang::CXXRecordDecl::hasTrivialDestructor(), clang::Type::isObjCLifetimeType(), clang::CXXMethodDecl::isVirtual(), clang::QualType::isVolatileQualified(), clang::CodeGen::NormalAndEHCleanup, clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, and clang::CodeGen::CodeGenFunction::PopCleanupBlock().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXDeleteExpr().
static llvm::Value* EmitTypeidFromVTable | ( | CodeGenFunction & | CGF, |
const Expr * | E, | ||
llvm::Type * | StdTypeInfoPtrTy | ||
) | [static] |
Definition at line 1660 of file CGExprCXX.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CGCXXABI::EmitBadTypeidCall(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitLValue(), clang::CodeGen::CGCXXABI::EmitTypeid(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::Expr::getType(), isGLValueFromPointerDeref(), and clang::CodeGen::CGCXXABI::shouldTypeidBeNullChecked().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXTypeidExpr().
static void EnterNewDeleteCleanup | ( | CodeGenFunction & | CGF, |
const CXXNewExpr * | E, | ||
llvm::Value * | NewPtr, | ||
llvm::Value * | AllocSize, | ||
const CallArgList & | NewArgs | ||
) | [static] |
Enter a cleanup to call 'operator delete' if the initializer in a new-expression throws.
Definition at line 1190 of file CGExprCXX.cpp.
References clang::CodeGen::EHCleanup, clang::CodeGen::CodeGenFunction::EHStack, clang::CodeGen::RValue::get(), clang::CXXNewExpr::getNumPlacementArgs(), clang::CXXNewExpr::getOperatorDelete(), clang::CodeGen::CodeGenFunction::initFullExprCleanup(), clang::CodeGen::CodeGenFunction::isInConditionalBranch(), clang::CodeGen::EHScopeStack::pushCleanupWithExtra(), and clang::CodeGen::InvariantValue< T >::save().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXNewExpr().
static CXXRecordDecl* getCXXRecord | ( | const Expr * | E | ) | [static] |
Definition at line 96 of file CGExprCXX.cpp.
References clang::Type::castAs(), clang::Type::getAs(), clang::RecordType::getDecl(), clang::Type::getPointeeType(), and clang::Expr::getType().
Referenced by clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr().
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] |
Definition at line 749 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::getContext(), clang::CodeGen::CodeGenFunction::getEvaluationKind(), clang::QualType::getQualifiers(), clang::ASTContext::getTypeAlignInChars(), clang::CodeGen::AggValueSlot::IsDestructed, clang::CodeGen::AggValueSlot::IsNotAliased, clang::CodeGen::CodeGenFunction::MakeAddrLValue(), clang::CodeGen::TEK_Aggregate, clang::CodeGen::TEK_Complex, and clang::CodeGen::TEK_Scalar.
Referenced by clang::CodeGen::CodeGenFunction::EmitNewArrayInitializer(), and EmitNewInitializer().