Home | History | Annotate | Download | only in libSPIRV

Lines Matching refs:SPIRVType

1 //===- SPIRVType.h - Class to represent a SPIR-V Type -----------*- C++ -*-===//
58 class SPIRVType: public SPIRVEntry {
61 SPIRVType(SPIRVModule *M, unsigned TheWordCount, Op TheOpCode,
65 SPIRVType(Op TheOpCode):SPIRVEntry(TheOpCode){}
67 SPIRVType *getArrayElementType() const;
71 SPIRVType *getFunctionReturnType() const;
73 SPIRVType *getPointerElementType() const;
75 SPIRVType *getStructMemberType(size_t) const;
78 SPIRVType *getVectorComponentType() const;
106 class SPIRVTypeVoid:public SPIRVType {
110 :SPIRVType(M, 2, OpTypeVoid, TheId){}
112 SPIRVTypeVoid():SPIRVType(OpTypeVoid){}
117 class SPIRVTypeBool:public SPIRVType {
121 :SPIRVType(M, 2, OpTypeBool, TheId){}
123 SPIRVTypeBool():SPIRVType(OpTypeBool){}
128 class SPIRVTypeInt:public SPIRVType {
134 :SPIRVType(M, 4, OC , TheId), BitWidth(TheBitWidth),
139 SPIRVTypeInt():SPIRVType(OC), BitWidth(0), IsSigned(false){}
163 class SPIRVTypeFloat:public SPIRVType {
168 :SPIRVType(M, 3, OC, TheId), BitWidth(TheBitWidth){}
170 SPIRVTypeFloat():SPIRVType(OC), BitWidth(0){}
194 class SPIRVTypePointer:public SPIRVType {
199 SPIRVType *ElementType)
200 :SPIRVType(M, 4, OpTypePointer, TheId), ElemStorageClass(TheStorageClass),
205 SPIRVTypePointer():SPIRVType(OpTypePointer),
209 SPIRVType *getElementType() const {
210 return static_cast<SPIRVType *>(getEntry(ElemTypeId));
252 class SPIRVTypeVector:public SPIRVType {
255 SPIRVTypeVector(SPIRVModule *M, SPIRVId TheId, SPIRVType *TheCompType,
257 :SPIRVType(M, 4, OpTypeVector, TheId), CompType(TheCompType),
262 SPIRVTypeVector():SPIRVType(OpTypeVector), CompType(nullptr),
265 SPIRVType *getComponentType() const { return CompType;}
288 SPIRVType *CompType; // Component Type
293 class SPIRVTypeArray:public SPIRVType {
296 SPIRVTypeArray(SPIRVModule *M, SPIRVId TheId, SPIRVType *TheElemType,
299 SPIRVTypeArray():SPIRVType(OpTypeArray), ElemType(nullptr),
302 SPIRVType *getElementType() const { return ElemType;}
318 SPIRVType *ElemType; // Element Type
322 class SPIRVTypeOpaque:public SPIRVType {
326 :SPIRVType(M, 2 + getSizeInWords(TheName), OpTypeOpaque, TheId) {
331 SPIRVTypeOpaque():SPIRVType(OpTypeOpaque){}
389 class SPIRVTypeImage:public SPIRVType {
395 :SPIRVType(M, FixedWC, OC, TheId), SampledType(TheSampledType),
401 :SPIRVType(M, FixedWC + 1, OC, TheId), SampledType(TheSampledType),
406 SPIRVTypeImage():SPIRVType(OC), SampledType(SPIRVID_INVALID), Desc(){
428 SPIRVType *getSampledType() const {
429 return get<SPIRVType>(SampledType);
433 return std::vector<SPIRVEntry*>(1, get<SPIRVType>(SampledType));
462 class SPIRVTypeSampler:public SPIRVType {
467 :SPIRVType(M, FixedWC, OC, TheId){
470 SPIRVTypeSampler():SPIRVType(OC){
480 class SPIRVTypeSampledImage:public SPIRVType {
485 :SPIRVType(M, FixedWC, OC, TheId), ImgTy(TheImgTy){
488 SPIRVTypeSampledImage():SPIRVType(OC), ImgTy(nullptr){
513 class SPIRVTypePipeStorage :public SPIRVType {
518 :SPIRVType(M, FixedWC, OC, TheId){
521 SPIRVTypePipeStorage() :SPIRVType(OC){
531 class SPIRVTypeStruct : public SPIRVType {
535 const std::vector<SPIRVType *> &TheMemberTypes,
537 : SPIRVType(M, 2 + TheMemberTypes.size(), OpTypeStruct, TheId) {
546 : SPIRVType(M, 2 + NumMembers, OpTypeStruct, TheId) {
552 SPIRVTypeStruct() : SPIRVType(OpTypeStruct) {}
555 SPIRVType *getMemberType(size_t I) const {
556 return static_cast<SPIRVType *>(getEntry(MemberTypeIdVec[I]));
558 void setMemberType(size_t I, SPIRVType *Ty) { MemberTypeIdVec[I] = Ty->getId(); }
564 SPIRVType::setWordCount(WordCount);
584 class SPIRVTypeFunction:public SPIRVType {
587 SPIRVTypeFunction(SPIRVModule *M, SPIRVId TheId, SPIRVType *TheReturnType,
588 const std::vector<SPIRVType *> &TheParameterTypes)
589 :SPIRVType(M, 3 + TheParameterTypes.size(), OpTypeFunction, TheId),
594 SPIRVTypeFunction():SPIRVType(OpTypeFunction), ReturnType(NULL){}
596 SPIRVType *getReturnType() const { return ReturnType;}
598 SPIRVType *getParameterType(unsigned I) const { return ParamTypeVec[I];}
608 SPIRVType::setWordCount(WordCount);
618 SPIRVType *ReturnType; // Return Type
619 std::vector<SPIRVType *> ParamTypeVec; // Parameter Types
622 class SPIRVTypeOpaqueGeneric:public SPIRVType {
626 :SPIRVType(M, 2, TheOpCode, TheId){
631 SPIRVTypeOpaqueGeneric(Op TheOpCode):SPIRVType(TheOpCode),
655 #define _SPIRV_OP(x) typedef SPIRVOpaqueGenericType<OpType##x> SPIRVType##x;
660 class SPIRVTypeDeviceEvent : public SPIRVType {
664 : SPIRVType(M, 2, OpTypeDeviceEvent, TheId) {
669 SPIRVTypeDeviceEvent() : SPIRVType(OpTypeDeviceEvent) {}
680 class SPIRVTypeQueue : public SPIRVType {
684 : SPIRVType(M, 2, OpTypeQueue, TheId) {
689 SPIRVTypeQueue() : SPIRVType(OpTypeQueue) {}
699 class SPIRVTypePipe :public SPIRVType {
704 :SPIRVType(M, 3, OpTypePipe, TheId),
710 SPIRVTypePipe() :SPIRVType(OpTypePipe),