clang 24.0.0git
clang::CodeGenUtils Namespace Reference

Functions

bool canSkipVTablePointerInitialization (ASTContext &Ctx, const CXXDestructorDecl *Dtor)
 Check whether we need to initialize any vtable pointers before calling this destructor.
bool fieldHasTrivialDestructorBody (ASTContext &Context, const FieldDecl *Field)
 Check whether destructing Field has no observable behaviors, and thus can be skipped when creating a destructor body.
bool hasUnwindExceptions (const LangOptions &LangOpts)
 Determines whether the language options require us to model unwind exceptions.
bool isAAPCS (const TargetInfo &TargetInfo)
 Helper method to check if the underlying ABI is AAPCS.
bool isInitializerOfDynamicClass (const CXXCtorInitializer *BaseInit)
static bool hasTrivialDestructorBody (ASTContext &Context, const CXXRecordDecl *BaseClassDecl, const CXXRecordDecl *MostDerivedClassDecl)

Function Documentation

◆ canSkipVTablePointerInitialization()

bool clang::CodeGenUtils::canSkipVTablePointerInitialization ( ASTContext & Ctx,
const CXXDestructorDecl * Dtor )

◆ fieldHasTrivialDestructorBody()

bool clang::CodeGenUtils::fieldHasTrivialDestructorBody ( ASTContext & Context,
const FieldDecl * Field )

Check whether destructing Field has no observable behaviors, and thus can be skipped when creating a destructor body.

So non-record types, anonymous structs/unions, or record types where the destructor doesnt DO anything are considered as this version of 'trivial'. Note: This is a more liberal definition of trivial destruction than the C++ Standard's version, and thus cannot be used as a substitute for C++ Standard requirements.

Definition at line 52 of file CodeGenUtils.cpp.

References clang::Type::getAsCXXRecordDecl(), and hasTrivialDestructorBody().

Referenced by canSkipVTablePointerInitialization(), and hasTrivialDestructorBody().

◆ hasTrivialDestructorBody()

◆ hasUnwindExceptions()

bool clang::CodeGenUtils::hasUnwindExceptions ( const LangOptions & LangOpts)

Determines whether the language options require us to model unwind exceptions.

We treat -fexceptions as mandating this except under the fragile ObjC ABI with only ObjC exceptions enabled. This means, for example, that C with -fexceptions enables this.

Definition at line 90 of file CodeGenUtils.cpp.

References clang::ObjCRuntime::hasUnwindExceptions(), and clang::LangOptions::ObjCRuntime.

Referenced by clang::CIRGen::CIRGenModule::setCIRFunctionAttributesForDefinition(), and clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributesForDefinition().

◆ isAAPCS()

◆ isInitializerOfDynamicClass()