clang 20.0.0git
Functions
RecordLayoutBuilder.cpp File Reference
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTDiagnostic.h"
#include "clang/AST/Attr.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/Expr.h"
#include "clang/AST/RecordLayout.h"
#include "clang/AST/VTableBuilder.h"
#include "clang/Basic/TargetInfo.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/MathExtras.h"

Go to the source code of this file.

Functions

static uint64_t roundUpSizeToCharAlignment (uint64_t Size, const ASTContext &Context)
 
static bool isAIXLayout (const ASTContext &Context)
 
static unsigned getPaddingDiagFromTagKind (TagTypeKind Tag)
 Get diagnostic select index for tag kind for field padding diagnostic message.
 
static const CXXMethodDeclcomputeKeyFunction (ASTContext &Context, const CXXRecordDecl *RD)
 
static bool mustSkipTailPadding (TargetCXXABI ABI, const CXXRecordDecl *RD)
 Does the target C++ ABI require us to skip over the tail-padding of the given class (considering it as a base class) when allocating objects?
 
static bool isMsLayout (const ASTContext &Context)
 
static bool recordUsesEBO (const RecordDecl *RD)
 
static bool RequiresVtordisp (const llvm::SmallPtrSetImpl< const CXXRecordDecl * > &BasesWithOverriddenMethods, const CXXRecordDecl *RD)
 
static uint64_t getFieldOffset (const ASTContext &C, const FieldDecl *FD)
 
static void PrintOffset (raw_ostream &OS, CharUnits Offset, unsigned IndentLevel)
 
static void PrintBitFieldOffset (raw_ostream &OS, CharUnits Offset, unsigned Begin, unsigned Width, unsigned IndentLevel)
 
static void PrintIndentNoOffset (raw_ostream &OS, unsigned IndentLevel)
 
static void DumpRecordLayout (raw_ostream &OS, const RecordDecl *RD, const ASTContext &C, CharUnits Offset, unsigned IndentLevel, const char *Description, bool PrintSizeInfo, bool IncludeVirtualBases)
 

Function Documentation

◆ computeKeyFunction()

static const CXXMethodDecl * computeKeyFunction ( ASTContext Context,
const CXXRecordDecl RD 
)
static

◆ DumpRecordLayout()

static void DumpRecordLayout ( raw_ostream &  OS,
const RecordDecl RD,
const ASTContext C,
CharUnits  Offset,
unsigned  IndentLevel,
const char *  Description,
bool  PrintSizeInfo,
bool  IncludeVirtualBases 
)
static

◆ getFieldOffset()

static uint64_t getFieldOffset ( const ASTContext C,
const FieldDecl FD 
)
static

◆ getPaddingDiagFromTagKind()

static unsigned getPaddingDiagFromTagKind ( TagTypeKind  Tag)
static

Get diagnostic select index for tag kind for field padding diagnostic message.

WARNING: Indexes apply to particular diagnostics only!

Returns
diagnostic select index.

Definition at line 2274 of file RecordLayoutBuilder.cpp.

References clang::Class, clang::Interface, and clang::Struct.

◆ isAIXLayout()

static bool isAIXLayout ( const ASTContext Context)
static

◆ isMsLayout()

static bool isMsLayout ( const ASTContext Context)
static

◆ mustSkipTailPadding()

static bool mustSkipTailPadding ( TargetCXXABI  ABI,
const CXXRecordDecl RD 
)
static

◆ PrintBitFieldOffset()

static void PrintBitFieldOffset ( raw_ostream &  OS,
CharUnits  Offset,
unsigned  Begin,
unsigned  Width,
unsigned  IndentLevel 
)
static

Definition at line 3584 of file RecordLayoutBuilder.cpp.

References Begin.

Referenced by DumpRecordLayout().

◆ PrintIndentNoOffset()

static void PrintIndentNoOffset ( raw_ostream &  OS,
unsigned  IndentLevel 
)
static

Definition at line 3602 of file RecordLayoutBuilder.cpp.

Referenced by DumpRecordLayout().

◆ PrintOffset()

static void PrintOffset ( raw_ostream &  OS,
CharUnits  Offset,
unsigned  IndentLevel 
)
static

Definition at line 3578 of file RecordLayoutBuilder.cpp.

Referenced by DumpRecordLayout().

◆ recordUsesEBO()

static bool recordUsesEBO ( const RecordDecl RD)
static

Definition at line 2917 of file RecordLayoutBuilder.cpp.

References clang::Decl::getAttr(), and clang::Decl::hasAttr().

◆ RequiresVtordisp()

static bool RequiresVtordisp ( const llvm::SmallPtrSetImpl< const CXXRecordDecl * > &  BasesWithOverriddenMethods,
const CXXRecordDecl RD 
)
static

Definition at line 3249 of file RecordLayoutBuilder.cpp.

References clang::CXXRecordDecl::bases(), and RequiresVtordisp().

Referenced by RequiresVtordisp().

◆ roundUpSizeToCharAlignment()

static uint64_t roundUpSizeToCharAlignment ( uint64_t  Size,
const ASTContext Context 
)
static