clang
3.9.0
|
#include "clang/AST/RecordLayout.h"
#include "clang/AST/ASTContext.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/Basic/TargetInfo.h"
#include "clang/Sema/SemaDiagnostic.h"
#include "llvm/ADT/SmallSet.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 unsigned | getPaddingDiagFromTagKind (TagTypeKind Tag) |
Get diagnostic select index for tag kind for field padding diagnostic message. More... | |
static const CXXMethodDecl * | computeKeyFunction (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) |
|
static |
Definition at line 1989 of file RecordLayoutBuilder.cpp.
References clang::TargetCXXABI::canKeyFunctionBeInline(), clang::TargetInfo::getCXXABI(), clang::ASTContext::getLangOpts(), clang::ASTContext::getTargetInfo(), clang::CXXRecordDecl::getTemplateSpecializationKind(), clang::NamedDecl::isExternallyVisible(), clang::FunctionDecl::isInlineSpecified(), clang::CXXRecordDecl::isPolymorphic(), clang::CXXRecordDecl::methods(), clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, and clang::TSK_ImplicitInstantiation.
Referenced by clang::ASTContext::getCurrentKeyFunction().
|
static |
Definition at line 3152 of file RecordLayoutBuilder.cpp.
References E, clang::RecordDecl::field_begin(), clang::RecordDecl::field_end(), clang::CharUnits::fromQuantity(), clang::ASTRecordLayout::getAlignment(), clang::Type::getAs(), clang::QualType::getAsString(), clang::ASTContext::getASTRecordLayout(), clang::ASTRecordLayout::getBaseClassOffset(), clang::FieldDecl::getBitWidthValue(), clang::ASTRecordLayout::getDataSize(), clang::RecordType::getDecl(), clang::ASTRecordLayout::getFieldOffset(), clang::NamedDecl::getName(), clang::ASTRecordLayout::getNonVirtualAlignment(), clang::ASTRecordLayout::getNonVirtualSize(), clang::ASTRecordLayout::getPrimaryBase(), clang::CharUnits::getQuantity(), clang::ASTRecordLayout::getSize(), clang::ValueDecl::getType(), clang::ASTContext::getTypeDeclType(), clang::ASTRecordLayout::getVBaseClassOffset(), clang::ASTRecordLayout::getVBaseOffsetsMap(), clang::ASTRecordLayout::getVBPtrOffset(), clang::ASTRecordLayout::hasOwnVBPtr(), clang::ASTRecordLayout::hasOwnVFPtr(), I, clang::FieldDecl::isBitField(), isMsLayout(), PrintBitFieldOffset(), PrintIndentNoOffset(), PrintOffset(), clang::ASTContext::toBits(), and clang::ASTContext::toCharUnitsFromBits().
|
static |
Definition at line 3056 of file RecordLayoutBuilder.cpp.
References clang::ASTContext::getASTRecordLayout(), clang::FieldDecl::getFieldIndex(), clang::ASTRecordLayout::getFieldOffset(), and clang::FieldDecl::getParent().
|
static |
Get diagnostic select index for tag kind for field padding diagnostic message.
WARNING: Indexes apply to particular diagnostics only!
Definition at line 1935 of file RecordLayoutBuilder.cpp.
References clang::TTK_Class, clang::TTK_Interface, and clang::TTK_Struct.
|
static |
Definition at line 2116 of file RecordLayoutBuilder.cpp.
References clang::TargetInfo::getCXXABI(), clang::ASTContext::getTargetInfo(), and clang::TargetCXXABI::isMicrosoft().
Referenced by clang::ASTContext::DumpRecordLayout(), DumpRecordLayout(), and clang::ASTContext::getASTRecordLayout().
|
static |
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?
Definition at line 2077 of file RecordLayoutBuilder.cpp.
References clang::TargetCXXABI::AlwaysUseTailPadding, clang::TargetCXXABI::getTailPaddingUseRules(), clang::CXXRecordDecl::isPOD(), clang::CXXRecordDecl::isStandardLayout(), clang::CXXRecordDecl::isTrivial(), clang::TargetCXXABI::UseTailPaddingUnlessPOD03, and clang::TargetCXXABI::UseTailPaddingUnlessPOD11.
Referenced by clang::ASTContext::getASTRecordLayout().
|
static |
Definition at line 3129 of file RecordLayoutBuilder.cpp.
References Buffer, and clang::CharUnits::getQuantity().
Referenced by DumpRecordLayout().
|
static |
Definition at line 3147 of file RecordLayoutBuilder.cpp.
Referenced by DumpRecordLayout().
Definition at line 3123 of file RecordLayoutBuilder.cpp.
References clang::CharUnits::getQuantity().
Referenced by DumpRecordLayout().
|
static |
Definition at line 2547 of file RecordLayoutBuilder.cpp.
References clang::LangOptions::MSVC2015.
|
static |
Definition at line 2838 of file RecordLayoutBuilder.cpp.
References clang::CXXRecordDecl::bases().
|
static |
Definition at line 1363 of file RecordLayoutBuilder.cpp.
References clang::TargetInfo::getCharAlign(), and clang::ASTContext::getTargetInfo().