diff options
Diffstat (limited to 'source/opt/instruction.h')
-rw-r--r-- | source/opt/instruction.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source/opt/instruction.h b/source/opt/instruction.h index e79c6289b..07c6aeef4 100644 --- a/source/opt/instruction.h +++ b/source/opt/instruction.h @@ -190,7 +190,7 @@ class Instruction : public utils::IntrusiveNodeBase<Instruction> { Instruction() : utils::IntrusiveNodeBase<Instruction>(), context_(nullptr), - opcode_(SpvOpNop), + opcode_(spv::Op::OpNop), has_type_id_(false), has_result_id_(false), unique_id_(0), @@ -200,7 +200,7 @@ class Instruction : public utils::IntrusiveNodeBase<Instruction> { Instruction(IRContext*); // Creates an instruction with the given opcode |op| and no additional logical // operands. - Instruction(IRContext*, SpvOp); + Instruction(IRContext*, spv::Op); // Creates an instruction using the given spv_parsed_instruction_t |inst|. All // the data inside |inst| will be copied and owned in this instance. And keep // record of line-related debug instructions |dbg_line| ahead of this @@ -213,7 +213,7 @@ class Instruction : public utils::IntrusiveNodeBase<Instruction> { // Creates an instruction with the given opcode |op|, type id: |ty_id|, // result id: |res_id| and input operands: |in_operands|. - Instruction(IRContext* c, SpvOp op, uint32_t ty_id, uint32_t res_id, + Instruction(IRContext* c, spv::Op op, uint32_t ty_id, uint32_t res_id, const OperandList& in_operands); // TODO: I will want to remove these, but will first have to remove the use of @@ -235,12 +235,12 @@ class Instruction : public utils::IntrusiveNodeBase<Instruction> { IRContext* context() const { return context_; } - SpvOp opcode() const { return opcode_; } + spv::Op opcode() const { return opcode_; } // Sets the opcode of this instruction to a specific opcode. Note this may // invalidate the instruction. // TODO(qining): Remove this function when instruction building and insertion // is well implemented. - void SetOpcode(SpvOp op) { opcode_ = op; } + void SetOpcode(spv::Op op) { opcode_ = op; } uint32_t type_id() const { return has_type_id_ ? GetSingleWordOperand(0) : 0; } @@ -625,7 +625,7 @@ class Instruction : public utils::IntrusiveNodeBase<Instruction> { bool IsValidBaseImage() const; IRContext* context_; // IR Context - SpvOp opcode_; // Opcode + spv::Op opcode_; // Opcode bool has_type_id_; // True if the instruction has a type id bool has_result_id_; // True if the instruction has a result id uint32_t unique_id_; // Unique instruction id @@ -732,12 +732,12 @@ inline void Instruction::SetResultType(uint32_t ty_id) { } inline bool Instruction::IsNop() const { - return opcode_ == SpvOpNop && !has_type_id_ && !has_result_id_ && + return opcode_ == spv::Op::OpNop && !has_type_id_ && !has_result_id_ && operands_.empty(); } inline void Instruction::ToNop() { - opcode_ = SpvOpNop; + opcode_ = spv::Op::OpNop; has_type_id_ = false; has_result_id_ = false; operands_.clear(); @@ -879,12 +879,12 @@ inline void Instruction::ForEachInOperand( inline bool Instruction::HasLabels() const { switch (opcode_) { - case SpvOpSelectionMerge: - case SpvOpBranch: - case SpvOpLoopMerge: - case SpvOpBranchConditional: - case SpvOpSwitch: - case SpvOpPhi: + case spv::Op::OpSelectionMerge: + case spv::Op::OpBranch: + case spv::Op::OpLoopMerge: + case spv::Op::OpBranchConditional: + case spv::Op::OpSwitch: + case spv::Op::OpPhi: return true; break; default: |