summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-specialize-dynamic-associatedtype-lookup.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2021-02-16 11:48:21 -0800
committerGitHub <noreply@github.com>2021-02-16 11:48:21 -0800
commite474c4e3aadc22a1b9f9b006104409f10936244f (patch)
treeb5f9567d3795fd2ea77d6c0478a58a569ea8eda9 /source/slang/slang-ir-specialize-dynamic-associatedtype-lookup.cpp
parent5777545ab7f82b91fde8779e7375628551add955 (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-dynamic-associatedtype-lookup.cpp')
-rw-r--r--source/slang/slang-ir-specialize-dynamic-associatedtype-lookup.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/slang/slang-ir-specialize-dynamic-associatedtype-lookup.cpp b/source/slang/slang-ir-specialize-dynamic-associatedtype-lookup.cpp
index eb77f651e..a5d19b517 100644
--- a/source/slang/slang-ir-specialize-dynamic-associatedtype-lookup.cpp
+++ b/source/slang/slang-ir-specialize-dynamic-associatedtype-lookup.cpp
@@ -143,7 +143,7 @@ struct AssociatedTypeLookupSpecializationContext
builder.sharedBuilder = &sharedContext->sharedBuilderStorage;
builder.setInsertBefore(inst);
auto witnessTableArg = inst->getWitnessTable();
- if (witnessTableArg->getDataType()->op == kIROp_WitnessTableType)
+ if (witnessTableArg->getDataType()->getOp() == kIROp_WitnessTableType)
{
witnessTableArg = builder.emitGetSequentialIDInst(witnessTableArg);
}
@@ -155,7 +155,7 @@ struct AssociatedTypeLookupSpecializationContext
void processGetSequentialIDInst(IRGetSequentialID* inst)
{
- if (inst->getRTTIOperand()->getDataType()->op == kIROp_WitnessTableIDType)
+ if (inst->getRTTIOperand()->getDataType()->getOp() == kIROp_WitnessTableIDType)
{
inst->replaceUsesWith(inst->getRTTIOperand());
inst->removeAndDeallocate();
@@ -179,7 +179,7 @@ struct AssociatedTypeLookupSpecializationContext
sharedContext->workListSet.Remove(inst);
func(inst);
- if (inst->op == kIROp_lookup_interface_method)
+ if (inst->getOp() == kIROp_lookup_interface_method)
{
processLookupInterfaceMethodInst(cast<IRLookupWitnessMethod>(inst));
}
@@ -196,7 +196,7 @@ struct AssociatedTypeLookupSpecializationContext
// Replace all `lookup_interface_method():IRWitnessTable` with call to specialized functions.
workOnModule([this](IRInst* inst)
{
- if (inst->op == kIROp_lookup_interface_method)
+ if (inst->getOp() == kIROp_lookup_interface_method)
{
processLookupInterfaceMethodInst(cast<IRLookupWitnessMethod>(inst));
}
@@ -205,7 +205,7 @@ struct AssociatedTypeLookupSpecializationContext
// Replace all direct uses of IRWitnessTables with its sequential ID.
workOnModule([this](IRInst* inst)
{
- if (inst->op == kIROp_WitnessTable)
+ if (inst->getOp() == kIROp_WitnessTable)
{
auto seqId = inst->findDecoration<IRSequentialIDDecoration>();
SLANG_ASSERT(seqId);
@@ -232,7 +232,7 @@ struct AssociatedTypeLookupSpecializationContext
// Replace all `IRWitnessTableType`s with `IRWitnessTableIDType`.
for (auto globalInst : sharedContext->module->getGlobalInsts())
{
- if (globalInst->op == kIROp_WitnessTableType)
+ if (globalInst->getOp() == kIROp_WitnessTableType)
{
IRBuilder builder;
builder.sharedBuilder = &sharedContext->sharedBuilderStorage;
@@ -243,7 +243,7 @@ struct AssociatedTypeLookupSpecializationContext
for (auto use = globalInst->firstUse; use; use = nextUse)
{
nextUse = use->nextUse;
- if (use->getUser()->op == kIROp_WitnessTable)
+ if (use->getUser()->getOp() == kIROp_WitnessTable)
continue;
use->set(witnessTableIDType);
}
@@ -253,7 +253,7 @@ struct AssociatedTypeLookupSpecializationContext
// `GetSequentialID(WitnessTableIDOperand)` becomes just `WitnessTableIDOperand`.
workOnModule([this](IRInst* inst)
{
- if (inst->op == kIROp_GetSequentialID)
+ if (inst->getOp() == kIROp_GetSequentialID)
{
processGetSequentialIDInst(cast<IRGetSequentialID>(inst));
}