clang API Documentation
Helper object for describing how to generate the code for access to a bit-field. More...
#include <CGRecordLayout.h>
Classes | |
| struct | AccessInfo |
Public Member Functions | |
| CGBitFieldInfo (unsigned Size, unsigned NumComponents, AccessInfo *_Components, bool IsSigned) | |
| bool | isSigned () const |
| Check whether this bit-field access is (i.e., should be sign extended on loads). | |
| unsigned | getSize () const |
| Get the size of the bit-field, in bits. | |
| void | print (raw_ostream &OS) const |
| void | dump () const |
Component Access | |
| unsigned | getNumComponents () const |
| const AccessInfo & | getComponent (unsigned Index) const |
Static Public Member Functions | |
| static CGBitFieldInfo | MakeInfo (class CodeGenTypes &Types, const FieldDecl *FD, uint64_t FieldOffset, uint64_t FieldSize) |
| Given a bit-field decl, build an appropriate helper object for accessing that field (which is expected to have the given offset and size). | |
| static CGBitFieldInfo | MakeInfo (CodeGenTypes &Types, const FieldDecl *FD, uint64_t FieldOffset, uint64_t FieldSize, uint64_t ContainingTypeSizeInBits, unsigned ContainingTypeAlign) |
| Given a bit-field decl, build an appropriate helper object for accessing that field (which is expected to have the given offset and size). The field decl should be known to be contained within a type of at least the given size and with the given alignment. | |
Helper object for describing how to generate the code for access to a bit-field.
This structure is intended to describe the "policy" of how the bit-field should be accessed, which may be target, language, or ABI dependent.
Definition at line 31 of file CGRecordLayout.h.
| clang::CodeGen::CGBitFieldInfo::CGBitFieldInfo | ( | unsigned | Size, |
| unsigned | NumComponents, | ||
| AccessInfo * | _Components, | ||
| bool | IsSigned | ||
| ) | [inline] |
Definition at line 100 of file CGRecordLayout.h.
References clang::CodeGen::CGBitFieldInfo::AccessInfo::AccessWidth, clang::CodeGen::CGBitFieldInfo::AccessInfo::FieldBitStart, getComponent(), getNumComponents(), clang::CodeGen::CGBitFieldInfo::AccessInfo::TargetBitOffset, and clang::CodeGen::CGBitFieldInfo::AccessInfo::TargetBitWidth.
Referenced by MakeInfo().
| void CGBitFieldInfo::dump | ( | ) | const |
Definition at line 1172 of file CGRecordLayoutBuilder.cpp.
References print().
| const AccessInfo& clang::CodeGen::CGBitFieldInfo::getComponent | ( | unsigned | Index | ) | const [inline] |
Definition at line 141 of file CGRecordLayout.h.
References getNumComponents(), and Index.
Referenced by CGBitFieldInfo(), clang::CodeGen::CodeGenTypes::ComputeRecordLayout(), clang::CodeGen::CodeGenFunction::EmitLoadOfBitfieldLValue(), clang::CodeGen::CodeGenFunction::EmitStoreThroughBitfieldLValue(), and print().
| unsigned clang::CodeGen::CGBitFieldInfo::getNumComponents | ( | ) | const [inline] |
Definition at line 139 of file CGRecordLayout.h.
Referenced by CGBitFieldInfo(), clang::CodeGen::CodeGenTypes::ComputeRecordLayout(), clang::CodeGen::CodeGenFunction::EmitLoadOfBitfieldLValue(), clang::CodeGen::CodeGenFunction::EmitStoreThroughBitfieldLValue(), getComponent(), and print().
| unsigned clang::CodeGen::CGBitFieldInfo::getSize | ( | ) | const [inline] |
Get the size of the bit-field, in bits.
Definition at line 134 of file CGRecordLayout.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitLoadOfBitfieldLValue(), and clang::CodeGen::CodeGenFunction::EmitStoreThroughBitfieldLValue().
| bool clang::CodeGen::CGBitFieldInfo::isSigned | ( | ) | const [inline] |
Check whether this bit-field access is (i.e., should be sign extended on loads).
Definition at line 131 of file CGRecordLayout.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitLoadOfBitfieldLValue(), and clang::CodeGen::CodeGenFunction::EmitStoreThroughBitfieldLValue().
| CGBitFieldInfo CGBitFieldInfo::MakeInfo | ( | class CodeGenTypes & | Types, |
| const FieldDecl * | FD, | ||
| uint64_t | FieldOffset, | ||
| uint64_t | FieldSize | ||
| ) | [static] |
Given a bit-field decl, build an appropriate helper object for accessing that field (which is expected to have the given offset and size).
Definition at line 356 of file CGRecordLayoutBuilder.cpp.
References clang::ASTRecordLayout::getAlignment(), clang::ASTContext::getASTRecordLayout(), clang::CodeGen::CodeGenTypes::getContext(), clang::FieldDecl::getParent(), clang::ASTRecordLayout::getSize(), and clang::ASTContext::toBits().
Referenced by clang::CodeGen::CGObjCRuntime::EmitValueForIvarAtOffset().
| CGBitFieldInfo CGBitFieldInfo::MakeInfo | ( | CodeGenTypes & | Types, |
| const FieldDecl * | FD, | ||
| uint64_t | FieldOffset, | ||
| uint64_t | FieldSize, | ||
| uint64_t | ContainingTypeSizeInBits, | ||
| unsigned | ContainingTypeAlign | ||
| ) | [static] |
Given a bit-field decl, build an appropriate helper object for accessing that field (which is expected to have the given offset and size). The field decl should be known to be contained within a type of at least the given size and with the given alignment.
Definition at line 232 of file CGRecordLayoutBuilder.cpp.
References clang::CodeGen::CGBitFieldInfo::AccessInfo::AccessAlignment, clang::CodeGen::CGBitFieldInfo::AccessInfo::AccessWidth, CGBitFieldInfo(), clang::CodeGen::CodeGenTypes::ConvertTypeForMem(), clang::CodeGen::CGBitFieldInfo::AccessInfo::FieldBitStart, clang::CodeGen::CGBitFieldInfo::AccessInfo::FieldByteOffset, clang::CodeGen::CGBitFieldInfo::AccessInfo::FieldIndex, clang::CharUnits::fromQuantity(), clang::TargetInfo::getCharWidth(), clang::CodeGen::CodeGenTypes::getCodeGenOpts(), clang::CodeGen::CodeGenTypes::getContext(), clang::TargetInfo::getRegisterWidth(), clang::CodeGen::CodeGenTypes::getTarget(), clang::CodeGen::CodeGenTypes::getTargetData(), clang::ValueDecl::getType(), clang::CodeGen::CGBitFieldInfo::AccessInfo::TargetBitOffset, clang::CodeGen::CGBitFieldInfo::AccessInfo::TargetBitWidth, clang::ASTContext::toBits(), clang::ASTContext::toCharUnitsFromBits(), and clang::CodeGenOptions::UseRegisterSizedBitfieldAccess.
| void CGBitFieldInfo::print | ( | raw_ostream & | OS | ) | const |
Definition at line 1143 of file CGRecordLayoutBuilder.cpp.
References clang::CodeGen::CGBitFieldInfo::AccessInfo::AccessAlignment, clang::CodeGen::CGBitFieldInfo::AccessInfo::AccessWidth, clang::CodeGen::CGBitFieldInfo::AccessInfo::FieldBitStart, clang::CodeGen::CGBitFieldInfo::AccessInfo::FieldByteOffset, clang::CodeGen::CGBitFieldInfo::AccessInfo::FieldIndex, getComponent(), getNumComponents(), clang::CharUnits::getQuantity(), clang::CodeGen::CGBitFieldInfo::AccessInfo::TargetBitOffset, and clang::CodeGen::CGBitFieldInfo::AccessInfo::TargetBitWidth.
Referenced by dump().