|
clang 22.0.0git
|
#include "/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CodeGen/HLSLBufferLayoutBuilder.h"
Public Member Functions | |
| HLSLBufferLayoutBuilder (CodeGenModule &CGM) | |
| llvm::StructType * | layOutStruct (const RecordType *StructType, const CGHLSLOffsetInfo &OffsetInfo) |
| Lays out a struct type following HLSL buffer rules and considering any explicit offset information. | |
| llvm::Type * | layOutArray (const ConstantArrayType *AT) |
| Lays out an array type following HLSL buffer rules. | |
| llvm::Type * | layOutType (QualType Type) |
| Lays out a type following HLSL buffer rules. | |
Definition at line 24 of file HLSLBufferLayoutBuilder.h.
|
inline |
Definition at line 29 of file HLSLBufferLayoutBuilder.h.
| llvm::Type * clang::CodeGen::HLSLBufferLayoutBuilder::layOutArray | ( | const ConstantArrayType * | AT | ) |
Lays out an array type following HLSL buffer rules.
Definition at line 106 of file HLSLBufferLayoutBuilder.cpp.
References clang::CharUnits::alignTo(), CBufferRowSize, clang::CharUnits::fromQuantity(), clang::ArrayType::getElementType(), clang::ConstantArrayType::getZExtSize(), clang::CharUnits::isZero(), and layOutType().
Referenced by layOutType().
| llvm::StructType * clang::CodeGen::HLSLBufferLayoutBuilder::layOutStruct | ( | const RecordType * | StructType, |
| const CGHLSLOffsetInfo & | OffsetInfo ) |
Lays out a struct type following HLSL buffer rules and considering any explicit offset information.
Previously created layout structs are cached by CGHLSLRuntime.
The function iterates over all fields of the record type (including base classes) and works out a padded llvm type to represent the buffer layout.
If a non-empty OffsetInfo is provided (ie, from packoffset annotations in the source), any provided offsets offsets will be respected. If the OffsetInfo is available but has empty entries, those will be layed out at the end of the structure.
Definition at line 31 of file HLSLBufferLayoutBuilder.cpp.
References clang::CharUnits::alignTo(), clang::CXXRecordDecl::bases_begin(), clang::Type::castAsCXXRecordDecl(), CBufferRowSize, clang::CodeGen::CGHLSLOffsetInfo::compareOffsets(), clang::CodeGen::Decl, clang::CodeGen::CGHLSLOffsetInfo::empty(), clang::CharUnits::fromQuantity(), clang::CXXRecordDecl::getNumBases(), clang::CXXBaseSpecifier::getType(), layOutType(), clang::CodeGen::CGHLSLOffsetInfo::Unspecified, and clang::CharUnits::Zero().
Referenced by clang::CodeGen::CGHLSLRuntime::emitBufferMemberExpr(), and layOutType().
| llvm::Type * clang::CodeGen::HLSLBufferLayoutBuilder::layOutType | ( | QualType | Type | ) |
Lays out a type following HLSL buffer rules.
Arrays and structures will be padded appropriately and nested objects will be converted as appropriate.
Definition at line 130 of file HLSLBufferLayoutBuilder.cpp.
References clang::Type::getAsCanonical(), clang::Type::isStructureOrClassType(), layOutArray(), and layOutStruct().
Referenced by clang::CodeGen::CGHLSLRuntime::emitBufferArraySubscriptExpr(), layOutArray(), and layOutStruct().