clang  3.9.0
Functions
CGClass.cpp File Reference
#include "CGBlocks.h"
#include "CGCXXABI.h"
#include "CGDebugInfo.h"
#include "CGRecordLayout.h"
#include "CodeGenFunction.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/EvaluatedExprVisitor.h"
#include "clang/AST/RecordLayout.h"
#include "clang/AST/StmtCXX.h"
#include "clang/Basic/TargetBuiltins.h"
#include "clang/CodeGen/CGFunctionInfo.h"
#include "clang/Frontend/CodeGenOptions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Metadata.h"
#include "llvm/Transforms/Utils/SanitizerStats.h"
Include dependency graph for CGClass.cpp:

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, CXXCtorType CtorType)
 
static void EmitAggMemberInitializer (CodeGenFunction &CGF, LValue LHS, Expr *Init, Address ArrayIndexVar, QualType T, ArrayRef< VarDecl * > ArrayIndexes, unsigned Index)
 
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 IsConstructorDelegationValid (const CXXConstructorDecl *Ctor)
 Checks whether the given constructor is a valid subject for the complete-to-base constructor delegation optimization, i.e. More...
 
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. More...
 
static bool canEmitDelegateCallArgs (CodeGenFunction &CGF, const CXXConstructorDecl *Ctor, CXXCtorType Type, CallArgList &Args)
 
static const CXXRecordDeclLeastDerivedClassWithSameLayout (const CXXRecordDecl *RD)
 
static const ExprskipNoOpCastsAndParens (const Expr *E)
 

Function Documentation

static Address ApplyNonVirtualAndVirtualOffset ( CodeGenFunction CGF,
Address  addr,
CharUnits  nonVirtualOffset,
llvm::Value virtualOffset,
const CXXRecordDecl derivedClass,
const CXXRecordDecl nearestVBase 
)
static
static bool BaseInitializerUsesThis ( ASTContext C,
const Expr Init 
)
static

Definition at line 514 of file CGClass.cpp.

Referenced by EmitBaseInitializer().

static bool canEmitDelegateCallArgs ( CodeGenFunction CGF,
const CXXConstructorDecl Ctor,
CXXCtorType  Type,
CallArgList Args 
)
static
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 1484 of file CGClass.cpp.

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

Referenced by clang::CodeGen::CodeGenFunction::EmitDestructorBody().

static void EmitAggMemberInitializer ( CodeGenFunction CGF,
LValue  LHS,
Expr Init,
Address  ArrayIndexVar,
QualType  T,
ArrayRef< VarDecl * >  ArrayIndexes,
unsigned  Index 
)
static
static void EmitBaseInitializer ( CodeGenFunction CGF,
const CXXRecordDecl ClassDecl,
CXXCtorInitializer BaseInit,
CXXCtorType  CtorType 
)
static
static void EmitLValueForAnyFieldInitialization ( CodeGenFunction CGF,
CXXCtorInitializer MemberInit,
LValue LHS 
)
static
static void EmitMemberInitializer ( CodeGenFunction CGF,
const CXXRecordDecl ClassDecl,
CXXCtorInitializer MemberInit,
const CXXConstructorDecl Constructor,
FunctionArgList Args 
)
static

Definition at line 695 of file CGClass.cpp.

References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CGBuilderTy::CreateLoad(), 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::CXXCtorInitializer::getArrayIndices(), clang::ASTContext::getAsConstantArrayType(), clang::ASTContext::getBaseElementType(), clang::CXXConstructExpr::getConstructor(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::CXXCtorInitializer::getInit(), clang::CXXCtorInitializer::getNumArrayIndices(), clang::CXXCtorInitializer::getSourceLocation(), clang::CodeGen::CGCXXABI::getSrcArgforCopyCtor(), clang::ASTContext::getTypeDeclType(), clang::CXXCtorInitializer::isAnyMemberInitializer(), clang::CXXConstructorDecl::isCopyOrMoveConstructor(), clang::FunctionDecl::isDefaulted(), clang::QualType::isDestructedType(), isMemcpyEquivalentSpecialMember(), clang::QualType::isPODType(), clang::CodeGen::LValue::isVolatileQualified(), clang::CodeGen::CodeGenFunction::LoadCXXThis(), clang::CodeGen::CodeGenFunction::MakeNaturalAlignAddrLValue(), clang::CodeGen::CodeGenFunction::needsEHCleanup(), and clang::CodeGen::CodeGenFunction::pushEHDestroy().

static bool FieldHasTrivialDestructorBody ( ASTContext Context,
const FieldDecl Field 
)
static
static bool HasTrivialDestructorBody ( ASTContext Context,
const CXXRecordDecl BaseClassDecl,
const CXXRecordDecl MostDerivedClassDecl 
)
static
static bool IsConstructorDelegationValid ( const CXXConstructorDecl Ctor)
static

Checks whether the given constructor is a valid subject for the complete-to-base constructor delegation optimization, i.e.

emitting the complete constructor as a simple call to the base constructor.

Definition at line 807 of file CGClass.cpp.

References clang::Type::getAs(), clang::CXXRecordDecl::getNumVBases(), clang::CXXMethodDecl::getParent(), clang::ValueDecl::getType(), and clang::CXXConstructorDecl::isDelegatingConstructor().

Referenced by clang::CodeGen::CodeGenFunction::EmitConstructorBody().

static bool isInitializerOfDynamicClass ( const CXXCtorInitializer BaseInit)
static
static bool isMemcpyEquivalentSpecialMember ( const CXXMethodDecl D)
static
static const CXXRecordDecl* LeastDerivedClassWithSameLayout ( const CXXRecordDecl RD)
static
static const Expr* skipNoOpCastsAndParens ( const Expr E)
static

Definition at line 2810 of file CGClass.cpp.

References E.

Referenced by clang::CodeGen::CodeGenFunction::CanDevirtualizeMemberFunctionCall().