summaryrefslogtreecommitdiff
path: root/lib/SPIRV/libSPIRV/SPIRVBasicBlock.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/SPIRV/libSPIRV/SPIRVBasicBlock.h')
-rw-r--r--lib/SPIRV/libSPIRV/SPIRVBasicBlock.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/SPIRV/libSPIRV/SPIRVBasicBlock.h b/lib/SPIRV/libSPIRV/SPIRVBasicBlock.h
index ccbd292..5ed2f9e 100644
--- a/lib/SPIRV/libSPIRV/SPIRVBasicBlock.h
+++ b/lib/SPIRV/libSPIRV/SPIRVBasicBlock.h
@@ -79,6 +79,11 @@ public:
void setScope(SPIRVEntry *Scope);
void setParent(SPIRVFunction *F) { ParentF = F;}
SPIRVInstruction *addInstruction(SPIRVInstruction *I);
+ void eraseInstruction(const SPIRVInstruction *I) {
+ auto Loc = find(I);
+ assert(Loc != InstVec.end());
+ InstVec.erase(Loc);
+ }
void setAttr() { setHasNoType();}
_SPIRV_DCL_ENCDEC
@@ -97,6 +102,10 @@ private:
const {
return std::find(InstVec.begin(), InstVec.end(), Inst);
}
+
+ SPIRVInstructionVector::iterator find(const SPIRVInstruction *Inst) {
+ return std::find(InstVec.begin(), InstVec.end(), Inst);
+ }
};
typedef SPIRVBasicBlock SPIRVLabel;