clang API Documentation

Classes | Public Member Functions | Static Public Member Functions
clang::CodeGen::CGBitFieldInfo Class Reference

Helper object for describing how to generate the code for access to a bit-field. More...

#include <CGRecordLayout.h>

List of all members.

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 AccessInfogetComponent (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.

Detailed Description

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.


Constructor & Destructor Documentation

clang::CodeGen::CGBitFieldInfo::CGBitFieldInfo ( unsigned  Size,
unsigned  NumComponents,
AccessInfo _Components,
bool  IsSigned 
) [inline]

Member Function Documentation

void CGBitFieldInfo::dump ( ) const

Definition at line 1172 of file CGRecordLayoutBuilder.cpp.

References print().

const AccessInfo& clang::CodeGen::CGBitFieldInfo::getComponent ( unsigned  Index) const [inline]
unsigned clang::CodeGen::CGBitFieldInfo::getNumComponents ( ) const [inline]
unsigned clang::CodeGen::CGBitFieldInfo::getSize ( ) const [inline]
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]
void CGBitFieldInfo::print ( raw_ostream &  OS) const

The documentation for this class was generated from the following files: