clang
24.0.0git
include
clang
CodeGenUtils
RecordLayoutUtils.h
Go to the documentation of this file.
1
//===--- RecordLayoutUtils.h - Shared record layout queries -----*- 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
// This file holds the AST queries about record layout that both classic
10
// CodeGen and CIR CodeGen need while lowering a record to its target type.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#ifndef LLVM_CLANG_CODEGENUTILS_RECORDLAYOUTUTILS_H
15
#define LLVM_CLANG_CODEGENUTILS_RECORDLAYOUTUTILS_H
16
17
#include "
clang/AST/ASTContext.h
"
18
19
namespace
clang::CodeGenUtils
{
20
21
/// The Microsoft bitfield layout rule allocates discrete storage units of the
22
/// field's formal type and only combines adjacent fields of the same formal
23
/// type. We want to emit a layout with these discrete storage units instead
24
/// of combining them into a continuous run.
25
bool
isDiscreteBitFieldABI
(
const
ASTContext &Ctx,
const
RecordDecl *RD);
26
27
/// Return true iff the field is "empty", that is, either a zero-width
28
/// bit-field or an \ref isEmptyRecordForLayout.
29
bool
isEmptyFieldForLayout
(
const
ASTContext &Ctx,
const
FieldDecl *FD);
30
31
/// Return true iff a structure contains only empty base classes (per \ref
32
/// isEmptyRecordForLayout) and fields (per \ref isEmptyFieldForLayout). Note,
33
/// C++ record fields are considered empty if the [[no_unique_address]]
34
/// attribute would have made them empty, so this is not the same as \ref
35
/// isEmptyRecord.
36
bool
isEmptyRecordForLayout
(
const
ASTContext &Ctx, QualType
T
);
37
38
/// The Itanium base layout rule allows virtual bases to overlap other bases,
39
/// which complicates layout in specific ways.
40
///
41
/// Note specifically that the ms_struct attribute doesn't change this.
42
bool
isOverlappingVBaseABI
(
const
ASTContext &Ctx);
43
44
}
// namespace clang::CodeGenUtils
45
46
#endif
// LLVM_CLANG_CODEGENUTILS_RECORDLAYOUTUTILS_H
ASTContext.h
Defines the clang::ASTContext interface.
clang::CodeGenUtils
Definition
CallUtils.h:21
clang::CodeGenUtils::isDiscreteBitFieldABI
bool isDiscreteBitFieldABI(const ASTContext &Ctx, const RecordDecl *RD)
The Microsoft bitfield layout rule allocates discrete storage units of the field's formal type and on...
Definition
RecordLayoutUtils.cpp:14
clang::CodeGenUtils::isOverlappingVBaseABI
bool isOverlappingVBaseABI(const ASTContext &Ctx)
The Itanium base layout rule allows virtual bases to overlap other bases, which complicates layout in...
Definition
RecordLayoutUtils.cpp:50
clang::CodeGenUtils::isEmptyFieldForLayout
bool isEmptyFieldForLayout(const ASTContext &Ctx, const FieldDecl *FD)
Return true iff the field is "empty", that is, either a zero-width bit-field or an isEmptyRecordForLa...
Definition
RecordLayoutUtils.cpp:18
clang::CodeGenUtils::isEmptyRecordForLayout
bool isEmptyRecordForLayout(const ASTContext &Ctx, QualType T)
Return true iff a structure contains only empty base classes (per isEmptyRecordForLayout) and fields ...
Definition
RecordLayoutUtils.cpp:28
clang::T
const FunctionProtoType * T
Definition
RecursiveASTVisitor.h:1425
Generated on
for clang by
1.14.0