clang 22.0.0git
clang::CodeGen::HLSLBufferLayoutBuilder Class Reference

#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.

Detailed Description

Definition at line 24 of file HLSLBufferLayoutBuilder.h.

Constructor & Destructor Documentation

◆ HLSLBufferLayoutBuilder()

clang::CodeGen::HLSLBufferLayoutBuilder::HLSLBufferLayoutBuilder ( CodeGenModule & CGM)
inline

Definition at line 29 of file HLSLBufferLayoutBuilder.h.

Member Function Documentation

◆ layOutArray()

llvm::Type * clang::CodeGen::HLSLBufferLayoutBuilder::layOutArray ( const ConstantArrayType * AT)

◆ layOutStruct()

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

◆ 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().


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

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant