24 assert((HandleTy->getName().ends_with(
".CBuffer") ||
25 HandleTy->getName() ==
"spirv.VulkanBuffer") &&
26 "Not a cbuffer type");
27 assert(HandleTy->getNumTypeParameters() == 1 &&
"Expected layout type");
31 for (
int I = 0,
E = LayoutTy->getNumElements();
I <
E; ++
I)
32 if (!IsPadding(LayoutTy->getElementType(
I)))
38std::optional<CBufferMetadata>
40 NamedMDNode *CBufMD = M.getNamedMetadata(
"hlsl.cbs");
44 std::optional<CBufferMetadata> Result({CBufMD});
47 assert(MD->getNumOperands() &&
"Invalid cbuffer metadata");
61 for (
int I = 1, E = MD->getNumOperands();
I < E; ++
I) {
67 Mapping.
Members.emplace_back(V, MemberOffsets[
I - 1]);
76 MD->eraseFromParent();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static SmallVector< size_t > getMemberOffsets(const DataLayout &DL, GlobalVariable *Handle, llvm::function_ref< bool(Type *)> IsPadding)
Module.h This file contains the declarations for the Module class.
A parsed version of the target data layout string in and methods for querying it.
Type * getValueType() const
A Module instance is used to store all the information related to an LLVM module.
iterator_range< op_iterator > operands()
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Used to lazily calculate structure layout information for a target machine, based on the DataLayout s...
TypeSize getElementOffset(unsigned Idx) const
The instances of the Type class are immutable: once they are created, they are never changed.
An efficient, type-erasing, non-owning reference to a callable.
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
SmallVector< CBufferMember > Members