clang 24.0.0git
CodeGenUtils.h
Go to the documentation of this file.
1//===--- CodeGenUtils.h - Shared Classic CodeGen/CIR CodeGen Utils--C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_CLANG_CODEGENUTILS_CODEGENUTILS_H
10#define LLVM_CLANG_CODEGENUTILS_CODEGENUTILS_H
11
13
15/// Check whether we need to initialize any vtable pointers before calling this
16/// destructor.
18 const CXXDestructorDecl *Dtor);
19
20/// Check whether destructing \p Field has no observable behaviors, and thus can
21/// be skipped when creating a destructor body. So non-record types, anonymous
22/// structs/unions, or record types where the destructor doesnt DO anything are
23/// considered as this version of 'trivial'.
24/// Note: This is a more liberal definition of trivial destruction than the C++
25/// Standard's version, and thus cannot be used as a substitute for C++ Standard
26/// requirements.
27bool fieldHasTrivialDestructorBody(ASTContext &Context, const FieldDecl *Field);
28
29/// Determines whether the language options require us to model
30/// unwind exceptions. We treat -fexceptions as mandating this
31/// except under the fragile ObjC ABI with only ObjC exceptions
32/// enabled. This means, for example, that C with -fexceptions
33/// enables this.
34bool hasUnwindExceptions(const LangOptions &LangOpts);
35
36/// Helper method to check if the underlying ABI is AAPCS
37bool isAAPCS(const TargetInfo &TargetInfo);
38
40} // namespace clang::CodeGenUtils
41
42#endif // LLVM_CLANG_CODEGENUTILS_CODEGENUTILS_H
Defines the clang::ASTContext interface.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition ASTContext.h:223
Represents a C++ base or member initializer.
Definition DeclCXX.h:2406
Represents a C++ destructor within a class.
Definition DeclCXX.h:2906
Represents a member of a struct/union/class.
Definition Decl.h:3295
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Exposes information about the current target.
Definition TargetInfo.h:226
bool isAAPCS(const TargetInfo &TargetInfo)
Helper method to check if the underlying ABI is AAPCS.
bool isInitializerOfDynamicClass(const CXXCtorInitializer *BaseInit)
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 ...
bool hasUnwindExceptions(const LangOptions &LangOpts)
Determines whether the language options require us to model unwind exceptions.