clang API Documentation

Public Attributes
clang::CodeGen::CGBitFieldInfo::AccessInfo Struct Reference

#include <CGRecordLayout.h>

Collaboration diagram for clang::CodeGen::CGBitFieldInfo::AccessInfo:
Collaboration graph
[legend]

List of all members.

Public Attributes

unsigned FieldIndex
 Offset of the field to load in the LLVM structure, if any.
CharUnits FieldByteOffset
unsigned FieldBitStart
unsigned AccessWidth
 Bit width of the memory access to perform.
CharUnits AccessAlignment
unsigned TargetBitOffset
 Offset for the target value.
unsigned TargetBitWidth
 Number of bits in the access that are destined for the bit-field.

Detailed Description

Descriptor for a single component of a bit-field access. The entire bit-field is constituted of a bitwise OR of all of the individual components.

Each component describes an accessed value, which is how the component should be transferred to/from memory, and a target placement, which is how that component fits into the constituted bit-field. The pseudo-IR for a load is:

%0 = gep base, 0, FieldIndex %1 = gep (i8*) %0, FieldByteOffset %2 = (i(AccessWidth) *) %1 %3 = load %2, align AccessAlignment %4 = shr %3, FieldBitStart

and the composed bit-field is formed as the boolean OR of all accesses, masked to TargetBitWidth bits and shifted to TargetBitOffset.

Definition at line 50 of file CGRecordLayout.h.


Member Data Documentation

Byte offset from the field address, if any. This should generally be unused as the cleanest IR comes from having a well-constructed LLVM type with proper GEP instructions, but sometimes its use is required, for example if an access is intended to straddle an LLVM field boundary.

Definition at line 58 of file CGRecordLayout.h.

Referenced by clang::CodeGen::CodeGenTypes::ComputeRecordLayout(), clang::CodeGen::CodeGenFunction::EmitLoadOfBitfieldLValue(), clang::CodeGen::CodeGenFunction::EmitStoreThroughBitfieldLValue(), clang::CodeGen::CGBitFieldInfo::MakeInfo(), and clang::CodeGen::CGBitFieldInfo::print().


The documentation for this struct was generated from the following file: