|
@@ -32,6 +32,9 @@ class SpirvVariable;
|
|
|
class SpirvString;
|
|
|
class Visitor;
|
|
|
|
|
|
+#define DEFINE_RELEASE_MEMORY_FOR_CLASS(cls) \
|
|
|
+ void releaseMemory() override { this->~cls(); }
|
|
|
+
|
|
|
/// \brief The base class for representing SPIR-V instructions.
|
|
|
class SpirvInstruction {
|
|
|
public:
|
|
@@ -122,6 +125,11 @@ public:
|
|
|
IK_VectorShuffle, // OpVectorShuffle
|
|
|
};
|
|
|
|
|
|
+ // All instruction classes should include a releaseMemory method.
|
|
|
+ // This is needed in order to avoid leaking memory for classes that include
|
|
|
+ // members that are not trivially destructible.
|
|
|
+ virtual void releaseMemory() = 0;
|
|
|
+
|
|
|
virtual ~SpirvInstruction() = default;
|
|
|
|
|
|
// Invokes SPIR-V visitor on this instruction.
|
|
@@ -218,6 +226,8 @@ class SpirvCapability : public SpirvInstruction {
|
|
|
public:
|
|
|
SpirvCapability(SourceLocation loc, spv::Capability cap);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvCapability)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_Capability;
|
|
@@ -238,6 +248,8 @@ class SpirvExtension : public SpirvInstruction {
|
|
|
public:
|
|
|
SpirvExtension(SourceLocation loc, llvm::StringRef extensionName);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvExtension)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_Extension;
|
|
@@ -258,6 +270,8 @@ class SpirvExtInstImport : public SpirvInstruction {
|
|
|
public:
|
|
|
SpirvExtInstImport(SourceLocation loc, llvm::StringRef extensionName);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvExtInstImport)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_ExtInstImport;
|
|
@@ -276,6 +290,8 @@ class SpirvMemoryModel : public SpirvInstruction {
|
|
|
public:
|
|
|
SpirvMemoryModel(spv::AddressingModel addrModel, spv::MemoryModel memModel);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvMemoryModel)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_MemoryModel;
|
|
@@ -298,6 +314,8 @@ public:
|
|
|
SpirvFunction *entryPoint, llvm::StringRef nameStr,
|
|
|
llvm::ArrayRef<SpirvVariable *> iface);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvEntryPoint)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_EntryPoint;
|
|
@@ -324,6 +342,8 @@ public:
|
|
|
spv::ExecutionMode, llvm::ArrayRef<uint32_t> params,
|
|
|
bool usesIdParams);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvExecutionMode)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_ExecutionMode;
|
|
@@ -346,6 +366,8 @@ class SpirvString : public SpirvInstruction {
|
|
|
public:
|
|
|
SpirvString(SourceLocation loc, llvm::StringRef stringLiteral);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvString)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_String;
|
|
@@ -365,6 +387,8 @@ public:
|
|
|
SpirvSource(SourceLocation loc, spv::SourceLanguage language, uint32_t ver,
|
|
|
SpirvString *file, llvm::StringRef src);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvSource)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_Source;
|
|
@@ -390,6 +414,8 @@ class SpirvModuleProcessed : public SpirvInstruction {
|
|
|
public:
|
|
|
SpirvModuleProcessed(SourceLocation loc, llvm::StringRef processStr);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvModuleProcessed)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_ModuleProcessed;
|
|
@@ -418,6 +444,8 @@ public:
|
|
|
spv::Decoration decor,
|
|
|
llvm::ArrayRef<SpirvInstruction *> params);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvDecoration)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_Decoration;
|
|
@@ -458,6 +486,8 @@ public:
|
|
|
spv::StorageClass sc, bool isPrecise,
|
|
|
SpirvInstruction *initializerId = 0);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvVariable)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_Variable;
|
|
@@ -489,6 +519,8 @@ public:
|
|
|
SpirvFunctionParameter(const SpirvType *spvType, bool isPrecise,
|
|
|
SourceLocation loc);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvFunctionParameter)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_FunctionParameter;
|
|
@@ -521,6 +553,8 @@ public:
|
|
|
SpirvLoopMerge(SourceLocation loc, SpirvBasicBlock *mergeBlock,
|
|
|
SpirvBasicBlock *contTarget, spv::LoopControlMask mask);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvLoopMerge)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_LoopMerge;
|
|
@@ -541,6 +575,8 @@ public:
|
|
|
SpirvSelectionMerge(SourceLocation loc, SpirvBasicBlock *mergeBlock,
|
|
|
spv::SelectionControlMask mask);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvSelectionMerge)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_SelectionMerge;
|
|
@@ -596,6 +632,8 @@ class SpirvBranch : public SpirvBranching {
|
|
|
public:
|
|
|
SpirvBranch(SourceLocation loc, SpirvBasicBlock *target);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvBranch)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_Branch;
|
|
@@ -622,6 +660,8 @@ public:
|
|
|
SpirvBasicBlock *trueLabel,
|
|
|
SpirvBasicBlock *falseLabel);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvBranchConditional)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_BranchConditional;
|
|
@@ -648,6 +688,8 @@ class SpirvKill : public SpirvTerminator {
|
|
|
public:
|
|
|
SpirvKill(SourceLocation loc);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvKill)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_Kill;
|
|
@@ -661,6 +703,8 @@ class SpirvReturn : public SpirvTerminator {
|
|
|
public:
|
|
|
SpirvReturn(SourceLocation loc, SpirvInstruction *retVal = 0);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvReturn)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_Return;
|
|
@@ -683,6 +727,8 @@ public:
|
|
|
SpirvBasicBlock *defaultLabel,
|
|
|
llvm::ArrayRef<std::pair<uint32_t, SpirvBasicBlock *>> &targetsVec);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvSwitch)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_Switch;
|
|
@@ -711,6 +757,8 @@ class SpirvUnreachable : public SpirvTerminator {
|
|
|
public:
|
|
|
SpirvUnreachable(SourceLocation loc);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvUnreachable)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_Unreachable;
|
|
@@ -729,6 +777,8 @@ public:
|
|
|
SpirvInstruction *base,
|
|
|
llvm::ArrayRef<SpirvInstruction *> indexVec);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvAccessChain)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_AccessChain;
|
|
@@ -776,6 +826,8 @@ public:
|
|
|
spv::MemorySemanticsMask semanticsUnequal,
|
|
|
SpirvInstruction *value, SpirvInstruction *comparator);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvAtomic)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_Atomic;
|
|
@@ -813,6 +865,8 @@ public:
|
|
|
spv::MemorySemanticsMask memorySemantics,
|
|
|
llvm::Optional<spv::Scope> executionScope = llvm::None);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvBarrier)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_Barrier;
|
|
@@ -900,6 +954,8 @@ public:
|
|
|
SpirvBinaryOp(spv::Op opcode, QualType resultType, SourceLocation loc,
|
|
|
SpirvInstruction *op1, SpirvInstruction *op2);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvBinaryOp)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_BinaryOp;
|
|
@@ -951,6 +1007,8 @@ public:
|
|
|
SpirvInstruction *base, SpirvInstruction *offset,
|
|
|
SpirvInstruction *count, bool isSigned);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvBitFieldExtract)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_BitFieldExtract;
|
|
@@ -969,6 +1027,8 @@ public:
|
|
|
SpirvInstruction *base, SpirvInstruction *insert,
|
|
|
SpirvInstruction *offset, SpirvInstruction *count);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvBitFieldInsert)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_BitFieldInsert;
|
|
@@ -1001,6 +1061,8 @@ class SpirvConstantBoolean : public SpirvConstant {
|
|
|
public:
|
|
|
SpirvConstantBoolean(QualType type, bool value, bool isSpecConst = false);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvConstantBoolean)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_ConstantBoolean;
|
|
@@ -1022,6 +1084,8 @@ public:
|
|
|
SpirvConstantInteger(QualType type, llvm::APInt value,
|
|
|
bool isSpecConst = false);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvConstantInteger)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_ConstantInteger;
|
|
@@ -1042,6 +1106,8 @@ public:
|
|
|
SpirvConstantFloat(QualType type, llvm::APFloat value,
|
|
|
bool isSpecConst = false);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvConstantFloat)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_ConstantFloat;
|
|
@@ -1063,6 +1129,8 @@ public:
|
|
|
llvm::ArrayRef<SpirvConstant *> constituents,
|
|
|
bool isSpecConst = false);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvConstantComposite)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_ConstantComposite;
|
|
@@ -1082,6 +1150,8 @@ class SpirvConstantNull : public SpirvConstant {
|
|
|
public:
|
|
|
SpirvConstantNull(QualType type);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvConstantNull)
|
|
|
+
|
|
|
bool invokeVisitor(Visitor *v) override;
|
|
|
|
|
|
// For LLVM-style RTTI
|
|
@@ -1098,6 +1168,8 @@ public:
|
|
|
SpirvCompositeConstruct(QualType resultType, SourceLocation loc,
|
|
|
llvm::ArrayRef<SpirvInstruction *> constituentsVec);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvCompositeConstruct)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_CompositeConstruct;
|
|
@@ -1120,6 +1192,8 @@ public:
|
|
|
SpirvInstruction *composite,
|
|
|
llvm::ArrayRef<uint32_t> indices);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvCompositeExtract)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_CompositeExtract;
|
|
@@ -1142,6 +1216,8 @@ public:
|
|
|
SpirvInstruction *composite, SpirvInstruction *object,
|
|
|
llvm::ArrayRef<uint32_t> indices);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvCompositeInsert)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_CompositeInsert;
|
|
@@ -1164,6 +1240,8 @@ class SpirvEmitVertex : public SpirvInstruction {
|
|
|
public:
|
|
|
SpirvEmitVertex(SourceLocation loc);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvEmitVertex)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_EmitVertex;
|
|
@@ -1177,6 +1255,8 @@ class SpirvEndPrimitive : public SpirvInstruction {
|
|
|
public:
|
|
|
SpirvEndPrimitive(SourceLocation loc);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvEndPrimitive)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_EndPrimitive;
|
|
@@ -1191,6 +1271,8 @@ public:
|
|
|
SpirvExtInst(QualType resultType, SourceLocation loc, SpirvExtInstImport *set,
|
|
|
uint32_t inst, llvm::ArrayRef<SpirvInstruction *> operandsVec);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvExtInst)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_ExtInst;
|
|
@@ -1215,6 +1297,8 @@ public:
|
|
|
SpirvFunction *function,
|
|
|
llvm::ArrayRef<SpirvInstruction *> argsVec);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvFunctionCall)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_FunctionCall;
|
|
@@ -1256,6 +1340,8 @@ public:
|
|
|
SourceLocation loc, spv::Scope scope,
|
|
|
SpirvInstruction *arg1, SpirvInstruction *arg2);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvNonUniformBinaryOp)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_GroupNonUniformBinaryOp;
|
|
@@ -1278,6 +1364,8 @@ public:
|
|
|
SpirvNonUniformElect(QualType resultType, SourceLocation loc,
|
|
|
spv::Scope scope);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvNonUniformElect)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_GroupNonUniformElect;
|
|
@@ -1294,6 +1382,8 @@ public:
|
|
|
llvm::Optional<spv::GroupOperation> group,
|
|
|
SpirvInstruction *arg);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvNonUniformUnaryOp)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_GroupNonUniformUnaryOp;
|
|
@@ -1353,6 +1443,8 @@ public:
|
|
|
SpirvInstruction *component = nullptr,
|
|
|
SpirvInstruction *texelToWrite = nullptr);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvImageOp)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_ImageOp;
|
|
@@ -1427,6 +1519,8 @@ public:
|
|
|
SpirvInstruction *img, SpirvInstruction *lod = nullptr,
|
|
|
SpirvInstruction *coord = nullptr);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvImageQuery)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_ImageQuery;
|
|
@@ -1452,6 +1546,8 @@ public:
|
|
|
SpirvImageSparseTexelsResident(QualType resultType, SourceLocation loc,
|
|
|
SpirvInstruction *resCode);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvImageSparseTexelsResident)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_ImageSparseTexelsResident;
|
|
@@ -1475,6 +1571,8 @@ public:
|
|
|
SpirvInstruction *image, SpirvInstruction *coordinate,
|
|
|
SpirvInstruction *sample);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvImageTexelPointer)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_ImageTexelPointer;
|
|
@@ -1498,6 +1596,8 @@ public:
|
|
|
SpirvLoad(QualType resultType, SourceLocation loc, SpirvInstruction *pointer,
|
|
|
llvm::Optional<spv::MemoryAccessMask> mask = llvm::None);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvLoad)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_Load;
|
|
@@ -1522,6 +1622,8 @@ public:
|
|
|
SpirvCopyObject(QualType resultType, SourceLocation loc,
|
|
|
SpirvInstruction *pointer);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvCopyObject)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_CopyObject;
|
|
@@ -1544,6 +1646,8 @@ public:
|
|
|
SpirvSampledImage(QualType resultType, SourceLocation loc,
|
|
|
SpirvInstruction *image, SpirvInstruction *sampler);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvSampledImage)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_SampledImage;
|
|
@@ -1565,6 +1669,8 @@ public:
|
|
|
SpirvSelect(QualType resultType, SourceLocation loc, SpirvInstruction *cond,
|
|
|
SpirvInstruction *trueId, SpirvInstruction *falseId);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvSelect)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_Select;
|
|
@@ -1589,6 +1695,8 @@ public:
|
|
|
SourceLocation loc, SpirvInstruction *operand1,
|
|
|
SpirvInstruction *operand2);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvSpecConstantBinaryOp)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_SpecConstantBinaryOp;
|
|
@@ -1612,6 +1720,8 @@ public:
|
|
|
SpirvSpecConstantUnaryOp(spv::Op specConstantOp, QualType resultType,
|
|
|
SourceLocation loc, SpirvInstruction *operand);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvSpecConstantUnaryOp)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_SpecConstantUnaryOp;
|
|
@@ -1634,6 +1744,8 @@ public:
|
|
|
SpirvInstruction *object,
|
|
|
llvm::Optional<spv::MemoryAccessMask> mask = llvm::None);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvStore)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_Store;
|
|
@@ -1697,6 +1809,8 @@ public:
|
|
|
SpirvUnaryOp(spv::Op opcode, QualType resultType, SourceLocation loc,
|
|
|
SpirvInstruction *op);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvUnaryOp)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_UnaryOp;
|
|
@@ -1718,6 +1832,8 @@ public:
|
|
|
SpirvInstruction *vec1, SpirvInstruction *vec2,
|
|
|
llvm::ArrayRef<uint32_t> componentsVec);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvVectorShuffle)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_VectorShuffle;
|
|
@@ -1740,6 +1856,8 @@ public:
|
|
|
SpirvArrayLength(QualType resultType, SourceLocation loc,
|
|
|
SpirvInstruction *structure, uint32_t arrayMember);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvArrayLength)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_ArrayLength;
|
|
@@ -1765,6 +1883,8 @@ public:
|
|
|
llvm::ArrayRef<SpirvInstruction *> vecOperands,
|
|
|
SourceLocation loc);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvRayTracingOpNV)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_RayTracingOpNV;
|
|
@@ -1777,12 +1897,15 @@ public:
|
|
|
private:
|
|
|
llvm::SmallVector<SpirvInstruction *, 4> operands;
|
|
|
};
|
|
|
+
|
|
|
class SpirvRayQueryOpKHR : public SpirvInstruction {
|
|
|
public:
|
|
|
SpirvRayQueryOpKHR(QualType resultType, spv::Op opcode,
|
|
|
llvm::ArrayRef<SpirvInstruction *> vecOperands, bool flags,
|
|
|
SourceLocation loc);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvRayQueryOpKHR)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_RayQueryOpKHR;
|
|
@@ -1810,6 +1933,8 @@ class SpirvDemoteToHelperInvocationEXT : public SpirvInstruction {
|
|
|
public:
|
|
|
SpirvDemoteToHelperInvocationEXT(SourceLocation);
|
|
|
|
|
|
+ DEFINE_RELEASE_MEMORY_FOR_CLASS(SpirvDemoteToHelperInvocationEXT)
|
|
|
+
|
|
|
// For LLVM-style RTTI
|
|
|
static bool classof(const SpirvInstruction *inst) {
|
|
|
return inst->getKind() == IK_DemoteToHelperInvocationEXT;
|