clang  14.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/VTableBuilder.h"
#include "clang/AST/RecordLayout.h"
#include "clang/Basic/TargetInfo.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/MathExtras.h"
Include dependency graph for RecordLayoutBuilder.cpp:

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. More...
 
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? More...
 
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 2231 of file RecordLayoutBuilder.cpp.

References clang::TTK_Class, clang::TTK_Interface, and clang::TTK_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 3492 of file RecordLayoutBuilder.cpp.

References Begin, and Offset.

Referenced by DumpRecordLayout().

◆ PrintIndentNoOffset()

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

Definition at line 3510 of file RecordLayoutBuilder.cpp.

Referenced by DumpRecordLayout().

◆ PrintOffset()

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

Definition at line 3486 of file RecordLayoutBuilder.cpp.

References Offset.

Referenced by DumpRecordLayout().

◆ recordUsesEBO()

static bool recordUsesEBO ( const RecordDecl RD)
static

◆ RequiresVtordisp()

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

Definition at line 3161 of file RecordLayoutBuilder.cpp.

References clang::CXXRecordDecl::bases().

◆ roundUpSizeToCharAlignment()

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