clang 20.0.0git
Functions
CGClass.cpp File Reference
#include "ABIInfoImpl.h"
#include "CGBlocks.h"
#include "CGCXXABI.h"
#include "CGDebugInfo.h"
#include "CGRecordLayout.h"
#include "CodeGenFunction.h"
#include "TargetInfo.h"
#include "clang/AST/Attr.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/CharUnits.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/EvaluatedExprVisitor.h"
#include "clang/AST/RecordLayout.h"
#include "clang/AST/StmtCXX.h"
#include "clang/Basic/CodeGenOptions.h"
#include "clang/Basic/TargetBuiltins.h"
#include "clang/CodeGen/CGFunctionInfo.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Metadata.h"
#include "llvm/Support/SaveAndRestore.h"
#include "llvm/Transforms/Utils/SanitizerStats.h"
#include <optional>

Go to the source code of this file.

Functions

static Address ApplyNonVirtualAndVirtualOffset (CodeGenFunction &CGF, Address addr, CharUnits nonVirtualOffset, llvm::Value *virtualOffset, const CXXRecordDecl *derivedClass, const CXXRecordDecl *nearestVBase)
 
static bool BaseInitializerUsesThis (ASTContext &C, const Expr *Init)
 
static void EmitBaseInitializer (CodeGenFunction &CGF, const CXXRecordDecl *ClassDecl, CXXCtorInitializer *BaseInit)
 
static bool isMemcpyEquivalentSpecialMember (const CXXMethodDecl *D)
 
static void EmitLValueForAnyFieldInitialization (CodeGenFunction &CGF, CXXCtorInitializer *MemberInit, LValue &LHS)
 
static void EmitMemberInitializer (CodeGenFunction &CGF, const CXXRecordDecl *ClassDecl, CXXCtorInitializer *MemberInit, const CXXConstructorDecl *Constructor, FunctionArgList &Args)
 
static bool isInitializerOfDynamicClass (const CXXCtorInitializer *BaseInit)
 
static bool FieldHasTrivialDestructorBody (ASTContext &Context, const FieldDecl *Field)
 
static bool HasTrivialDestructorBody (ASTContext &Context, const CXXRecordDecl *BaseClassDecl, const CXXRecordDecl *MostDerivedClassDecl)
 
static bool CanSkipVTablePointerInitialization (CodeGenFunction &CGF, const CXXDestructorDecl *Dtor)
 CanSkipVTablePointerInitialization - Check whether we need to initialize any vtable pointers before calling this destructor.
 
static bool canEmitDelegateCallArgs (CodeGenFunction &CGF, const CXXConstructorDecl *Ctor, CXXCtorType Type, CallArgList &Args)
 
static const CXXRecordDeclLeastDerivedClassWithSameLayout (const CXXRecordDecl *RD)
 

Function Documentation

◆ ApplyNonVirtualAndVirtualOffset()

static Address ApplyNonVirtualAndVirtualOffset ( CodeGenFunction CGF,
Address  addr,
CharUnits  nonVirtualOffset,
llvm::Value virtualOffset,
const CXXRecordDecl derivedClass,
const CXXRecordDecl nearestVBase 
)
static

◆ BaseInitializerUsesThis()

static bool BaseInitializerUsesThis ( ASTContext C,
const Expr Init 
)
static

Definition at line 551 of file CGClass.cpp.

References clang::C, and clang::Init.

Referenced by EmitBaseInitializer().

◆ canEmitDelegateCallArgs()

static bool canEmitDelegateCallArgs ( CodeGenFunction CGF,
const CXXConstructorDecl Ctor,
CXXCtorType  Type,
CallArgList Args 
)
static

◆ CanSkipVTablePointerInitialization()

static bool CanSkipVTablePointerInitialization ( CodeGenFunction CGF,
const CXXDestructorDecl Dtor 
)
static

CanSkipVTablePointerInitialization - Check whether we need to initialize any vtable pointers before calling this destructor.

Definition at line 1415 of file CGClass.cpp.

References FieldHasTrivialDestructorBody(), clang::RecordDecl::fields(), clang::CodeGen::CodeGenFunction::getContext(), clang::CXXMethodDecl::getParent(), clang::FunctionDecl::hasTrivialBody(), clang::CXXRecordDecl::isDynamicClass(), and clang::CXXRecordDecl::isEffectivelyFinal().

◆ EmitBaseInitializer()

static void EmitBaseInitializer ( CodeGenFunction CGF,
const CXXRecordDecl ClassDecl,
CXXCtorInitializer BaseInit 
)
static

◆ EmitLValueForAnyFieldInitialization()

static void EmitLValueForAnyFieldInitialization ( CodeGenFunction CGF,
CXXCtorInitializer MemberInit,
LValue &  LHS 
)
static

◆ EmitMemberInitializer()

static void EmitMemberInitializer ( CodeGenFunction CGF,
const CXXRecordDecl ClassDecl,
CXXCtorInitializer MemberInit,
const CXXConstructorDecl Constructor,
FunctionArgList Args 
)
static

Definition at line 630 of file CGClass.cpp.

References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CGBuilderTy::CreateLoad(), clang::Ctor_Base, clang::CodeGen::CodeGenFunction::CurGD, clang::CodeGen::CodeGenFunction::EmitAggregateCopy(), clang::CodeGen::CodeGenFunction::EmitInitializerForField(), EmitLValueForAnyFieldInitialization(), clang::CodeGen::CodeGenFunction::EmitLValueForFieldInitialization(), clang::CodeGen::LValue::getAddress(), clang::CodeGen::CodeGenFunction::GetAddrOfLocalVar(), clang::CXXCtorInitializer::getAnyMember(), clang::ASTContext::getAsConstantArrayType(), clang::ASTContext::getBaseElementType(), clang::CXXConstructExpr::getConstructor(), clang::CodeGen::CodeGenFunction::getContext(), clang::GlobalDecl::getCtorType(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::CXXCtorInitializer::getInit(), clang::CodeGen::CodeGenFunction::getOverlapForFieldInit(), clang::CXXCtorInitializer::getSourceLocation(), clang::CodeGen::CGCXXABI::getSrcArgforCopyCtor(), clang::ASTContext::getTypeDeclType(), clang::CXXCtorInitializer::isAnyMemberInitializer(), clang::QualType::isDestructedType(), isMemcpyEquivalentSpecialMember(), clang::QualType::isPODType(), clang::CodeGen::LValue::isVolatileQualified(), clang::CodeGen::CodeGenFunction::LoadCXXThis(), Loc, clang::CodeGen::CodeGenFunction::MakeNaturalAlignAddrLValue(), clang::CodeGen::CodeGenFunction::MakeNaturalAlignPointeeAddrLValue(), clang::CodeGen::CodeGenFunction::needsEHCleanup(), and clang::CodeGen::CodeGenFunction::pushEHDestroy().

◆ FieldHasTrivialDestructorBody()

static bool FieldHasTrivialDestructorBody ( ASTContext Context,
const FieldDecl Field 
)
static

◆ HasTrivialDestructorBody()

static bool HasTrivialDestructorBody ( ASTContext Context,
const CXXRecordDecl BaseClassDecl,
const CXXRecordDecl MostDerivedClassDecl 
)
static

◆ isInitializerOfDynamicClass()

static bool isInitializerOfDynamicClass ( const CXXCtorInitializer BaseInit)
static

◆ isMemcpyEquivalentSpecialMember()

static bool isMemcpyEquivalentSpecialMember ( const CXXMethodDecl D)
static

Definition at line 599 of file CGClass.cpp.

References D.

Referenced by EmitMemberInitializer().

◆ LeastDerivedClassWithSameLayout()

static const CXXRecordDecl * LeastDerivedClassWithSameLayout ( const CXXRecordDecl RD)
static