MLIR  20.0.0git
Public Attributes | List of all members
mlir::spirv::DeferredStructTypeInfo Struct Reference

A "deferred struct type" is a struct type with one or more member types not known when the Deserializer first encounters the struct. More...

#include "Target/SPIRV/Deserialization/Deserializer.h"

Public Attributes

spirv::StructType deferredStructType
 
SmallVector< std::pair< uint32_t, unsigned >, 0 > unresolvedMemberTypes
 
SmallVector< Type, 4 > memberTypes
 
SmallVector< spirv::StructType::OffsetInfo, 0 > offsetInfo
 
SmallVector< spirv::StructType::MemberDecorationInfo, 0 > memberDecorationsInfo
 

Detailed Description

A "deferred struct type" is a struct type with one or more member types not known when the Deserializer first encounters the struct.

This happens, for example, with recursive structs where a pointer to the struct type is forward declared through OpTypeForwardPointer in the SPIR-V module before the struct declaration; the actual pointer to struct type should be defined later through an OpTypePointer. For example, the following C struct:

struct A { A* next; };

would be represented in the SPIR-V module as:

OpName A "A" OpTypeForwardPointer APtr Generic A = OpTypeStruct APtr APtr = OpTypePointer Generic A

This means that the spirv::StructType cannot be fully constructed directly when the Deserializer encounters it. Instead we create a DeferredStructTypeInfo that contains all the information we know about the spirv::StructType. Once all forward references for the struct are resolved, the struct's body is set with all member info.

Definition at line 85 of file Deserializer.h.

Member Data Documentation

◆ deferredStructType

spirv::StructType mlir::spirv::DeferredStructTypeInfo::deferredStructType

Definition at line 86 of file Deserializer.h.

◆ memberDecorationsInfo

SmallVector<spirv::StructType::MemberDecorationInfo, 0> mlir::spirv::DeferredStructTypeInfo::memberDecorationsInfo

Definition at line 96 of file Deserializer.h.

◆ memberTypes

SmallVector<Type, 4> mlir::spirv::DeferredStructTypeInfo::memberTypes

Definition at line 94 of file Deserializer.h.

◆ offsetInfo

SmallVector<spirv::StructType::OffsetInfo, 0> mlir::spirv::DeferredStructTypeInfo::offsetInfo

Definition at line 95 of file Deserializer.h.

◆ unresolvedMemberTypes

SmallVector<std::pair<uint32_t, unsigned>, 0> mlir::spirv::DeferredStructTypeInfo::unresolvedMemberTypes

Definition at line 90 of file Deserializer.h.


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