diff options
| author | Tim Foley <tfoleyNV@users.noreply.github.com> | 2021-02-16 11:48:21 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-16 11:48:21 -0800 |
| commit | e474c4e3aadc22a1b9f9b006104409f10936244f (patch) | |
| tree | b5f9567d3795fd2ea77d6c0478a58a569ea8eda9 /source/slang/slang-ir-specialize.cpp | |
| parent | 5777545ab7f82b91fde8779e7375628551add955 (diff) | |
Add an accessor for IRInst opcode (#1707)
* Add an accessor for IRInst opcode
This main changing is renaming `IRInst::op` over to `IRInst::m_op` and then adds an accessor `IRInst::getOp()` to read it. The rest of the changes are just changing use sites to `getOp` (or to `m_op` in the limited cases where we write to it).
This work is in anticipation of a future change that might need to store an extra bit in the same field as the opcode. It seemed better to do this massive refactoring as a separate PR.
* fixup
Diffstat (limited to 'source/slang/slang-ir-specialize.cpp')
| -rw-r--r-- | source/slang/slang-ir-specialize.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/slang/slang-ir-specialize.cpp b/source/slang/slang-ir-specialize.cpp index 7fb6a06bd..e9300ae06 100644 --- a/source/slang/slang-ir-specialize.cpp +++ b/source/slang/slang-ir-specialize.cpp @@ -76,7 +76,7 @@ struct SpecializationContext // can't mark an interface as used until its requirements are // used, etc. // - if(inst->op == kIROp_InterfaceRequirementEntry) + if(inst->getOp() == kIROp_InterfaceRequirementEntry) return true; return fullySpecializedInsts.Contains(inst); @@ -396,7 +396,7 @@ struct SpecializationContext // since values are an important class of instruction we want // to deduplicate. - switch(inst->op) + switch(inst->getOp()) { default: // The default case is that an instruction can @@ -476,7 +476,7 @@ struct SpecializationContext void maybeSpecializeInst( IRInst* inst) { - switch(inst->op) + switch(inst->getOp()) { default: // By default we assume that specialization is @@ -1135,7 +1135,7 @@ struct SpecializationContext // we can simply check if the `concreteType` is a compile-time // constant value. // - if(concreteType->op == kIROp_ExtractExistentialType) + if(concreteType->getOp() == kIROp_ExtractExistentialType) return false; return true; @@ -1822,7 +1822,7 @@ struct SpecializationContext slotOperands.add(wrapInst->getSlotOperand(ii)); } - auto elementPtrType = builder.getPtrType(ptrType->op, elementType); + auto elementPtrType = builder.getPtrType(ptrType->getOp(), elementType); auto newElementAddr = builder.emitElementAddress(elementPtrType, val, index); auto newWrapExistentialInst = builder.emitWrapExistential( @@ -1921,7 +1921,7 @@ struct SpecializationContext type->getExistentialArgs()); auto newPtrLikeType = builder.getType( - baseType->op, + baseType->getOp(), 1, &wrappedElementType); addUsersToWorkList(type); @@ -2049,7 +2049,7 @@ struct SpecializationContext { next = inst->getNextInst(); - switch(inst->op) + switch(inst->getOp()) { default: break; |
