clang
24.0.0git
include
clang
CodeGenUtils
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
12
#include "
clang/AST/ASTContext.h
"
13
14
namespace
clang::CodeGenUtils
{
15
/// Check whether we need to initialize any vtable pointers before calling this
16
/// destructor.
17
bool
canSkipVTablePointerInitialization
(
ASTContext
&Ctx,
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.
27
bool
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.
34
bool
hasUnwindExceptions
(
const
LangOptions
&LangOpts);
35
36
/// Helper method to check if the underlying ABI is AAPCS
37
bool
isAAPCS
(
const
TargetInfo
&
TargetInfo
);
38
39
bool
isInitializerOfDynamicClass
(
const
CXXCtorInitializer
*BaseInit);
40
}
// namespace clang::CodeGenUtils
41
42
#endif
// LLVM_CLANG_CODEGENUTILS_CODEGENUTILS_H
ASTContext.h
Defines the clang::ASTContext interface.
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition
ASTContext.h:223
clang::CXXCtorInitializer
Represents a C++ base or member initializer.
Definition
DeclCXX.h:2406
clang::CXXDestructorDecl
Represents a C++ destructor within a class.
Definition
DeclCXX.h:2906
clang::FieldDecl
Represents a member of a struct/union/class.
Definition
Decl.h:3295
clang::LangOptions
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition
LangOptions.h:473
clang::TargetInfo
Exposes information about the current target.
Definition
TargetInfo.h:226
clang::CodeGenUtils
Definition
CodeGenUtils.h:14
clang::CodeGenUtils::isAAPCS
bool isAAPCS(const TargetInfo &TargetInfo)
Helper method to check if the underlying ABI is AAPCS.
Definition
CodeGenUtils.cpp:107
clang::CodeGenUtils::isInitializerOfDynamicClass
bool isInitializerOfDynamicClass(const CXXCtorInitializer *BaseInit)
Definition
CodeGenUtils.cpp:110
clang::CodeGenUtils::canSkipVTablePointerInitialization
bool canSkipVTablePointerInitialization(ASTContext &Ctx, const CXXDestructorDecl *Dtor)
Check whether we need to initialize any vtable pointers before calling this destructor.
Definition
CodeGenUtils.cpp:69
clang::CodeGenUtils::fieldHasTrivialDestructorBody
bool fieldHasTrivialDestructorBody(ASTContext &Context, const FieldDecl *Field)
Check whether destructing Field has no observable behaviors, and thus can be skipped when creating a ...
Definition
CodeGenUtils.cpp:52
clang::CodeGenUtils::hasUnwindExceptions
bool hasUnwindExceptions(const LangOptions &LangOpts)
Determines whether the language options require us to model unwind exceptions.
Definition
CodeGenUtils.cpp:90
Generated on
for clang by
1.14.0