summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2023-04-25 10:43:29 -0400
committerGitHub <noreply@github.com>2023-04-25 10:43:29 -0400
commit7b7c095b37e85ca3a8f55eff1c3d9643d467b8e0 (patch)
tree9c71955dbc956b0058b19818ca127c8132cda512 /source/slang/slang-ir.cpp
parent284cee1f246c072f190c87c8fb60c1d2181e458f (diff)
Dictionary using lowerCamel (#2835)
* #include an absolute path didn't work - because paths were taken to always be relative. * WIP lowerCamel Dictionary. * WIP more lowerCamel fixes for Dictionary. * Add/Remove/Clear * GetValue/Contains * Fix tabs in dictionary. Count -> getCount * Fix fields with caps. * Key -> key Value -> value Use m_ for members where appropriate. Use lowerCamel in linked list. * Some small fixes/improvements to Dictionary. * Kick CI.
Diffstat (limited to 'source/slang/slang-ir.cpp')
-rw-r--r--source/slang/slang-ir.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/source/slang/slang-ir.cpp b/source/slang/slang-ir.cpp
index 558fd7796..185f31b30 100644
--- a/source/slang/slang-ir.cpp
+++ b/source/slang/slang-ir.cpp
@@ -1238,7 +1238,7 @@ namespace Slang
auto user = use->getUser();
if (user->getModule())
{
- user->getModule()->getDeduplicationContext()->getInstReplacementMap().TryGetValue(newValue, newValue);
+ user->getModule()->getDeduplicationContext()->getInstReplacementMap().tryGetValue(newValue, newValue);
}
if (!getIROpInfo(user->getOp()).isHoistable())
@@ -1256,7 +1256,7 @@ namespace Slang
use->init(user, newValue);
IRInst* existingVal = nullptr;
- if (builder->getGlobalValueNumberingMap().TryGetValue(IRInstKey{ user }, existingVal))
+ if (builder->getGlobalValueNumberingMap().tryGetValue(IRInstKey{ user }, existingVal))
{
user->replaceUsesWith(existingVal);
return existingVal;
@@ -1710,7 +1710,7 @@ namespace Slang
Int const* listArgCounts,
IRInst* const* const* listArgs)
{
- m_dedupContext->getInstReplacementMap().TryGetValue((IRInst*)(type), *(IRInst**)&type);
+ m_dedupContext->getInstReplacementMap().tryGetValue((IRInst*)(type), *(IRInst**)&type);
if (getIROpInfo(op).flags & kIROpFlag_Hoistable)
{
@@ -1744,7 +1744,7 @@ namespace Slang
if (fixedArgs)
{
auto arg = fixedArgs[aa];
- m_dedupContext->getInstReplacementMap().TryGetValue(arg, arg);
+ m_dedupContext->getInstReplacementMap().tryGetValue(arg, arg);
operand->init(inst, arg);
}
else
@@ -1762,7 +1762,7 @@ namespace Slang
if (listArgs[ii])
{
auto arg = listArgs[ii][jj];
- m_dedupContext->getInstReplacementMap().TryGetValue(arg, arg);
+ m_dedupContext->getInstReplacementMap().tryGetValue(arg, arg);
operand->init(inst, arg);
}
else
@@ -2157,7 +2157,7 @@ namespace Slang
key.inst = &keyInst;
IRConstant* irValue = nullptr;
- if (m_dedupContext->getConstantMap().TryGetValue(key, irValue))
+ if (m_dedupContext->getConstantMap().tryGetValue(key, irValue))
{
// We found a match, so just use that.
return irValue;
@@ -2224,7 +2224,7 @@ namespace Slang
}
key.inst = irValue;
- m_dedupContext->getConstantMap().Add(key, irValue);
+ m_dedupContext->getConstantMap().add(key, irValue);
addHoistableInst(this, irValue);
@@ -2459,7 +2459,7 @@ namespace Slang
for (Int ii = 0; ii < fixedArgCount; ++ii)
{
auto arg = canonicalizedOperands[ii];
- m_dedupContext->getInstReplacementMap().TryGetValue(arg, arg);
+ m_dedupContext->getInstReplacementMap().tryGetValue(arg, arg);
operand->usedValue = arg;
operand++;
}
@@ -2469,7 +2469,7 @@ namespace Slang
for (UInt jj = 0; jj < listOperandCount; ++jj)
{
auto arg = listArgs[ii][jj];
- m_dedupContext->getInstReplacementMap().TryGetValue(arg, arg);
+ m_dedupContext->getInstReplacementMap().tryGetValue(arg, arg);
operand->usedValue = arg;
operand++;
}
@@ -2481,7 +2481,7 @@ namespace Slang
IRInstKey key = { inst };
// Ideally we would add if not found, else return if was found instead of testing & then adding.
- IRInst** found = m_dedupContext->getGlobalValueNumberingMap().TryGetValueOrAdd(key, inst);
+ IRInst** found = m_dedupContext->getGlobalValueNumberingMap().tryGetValueOrAdd(key, inst);
SLANG_ASSERT(endCursor == memoryArena.getCursor());
// If it's found, just return, and throw away the instruction
if (found)
@@ -5883,7 +5883,7 @@ namespace Slang
String key = sb.ProduceString();
UInt count = 0;
- context->uniqueNameCounters.TryGetValue(key, count);
+ context->uniqueNameCounters.tryGetValue(key, count);
context->uniqueNameCounters[key] = count+1;
@@ -5907,11 +5907,11 @@ namespace Slang
IRInst* value)
{
String name;
- if (context->mapValueToName.TryGetValue(value, name))
+ if (context->mapValueToName.tryGetValue(value, name))
return name;
name = createName(context, value);
- context->mapValueToName.Add(value, name);
+ context->mapValueToName.add(value, name);
return name;
}
@@ -6773,7 +6773,7 @@ namespace Slang
auto addToWorkList = [&](IRInst* src, IRInst* target)
{
- if (workListSet.Add(src))
+ if (workListSet.add(src))
{
WorkItem item;
item.thisInst = src;
@@ -6841,7 +6841,7 @@ namespace Slang
// Is the updated inst already exists in the global numbering map?
// If so, we need to continue work on replacing the updated inst with the existing value.
IRInst* existingVal = nullptr;
- if (dedupContext->getGlobalValueNumberingMap().TryGetValue(IRInstKey{ user }, existingVal))
+ if (dedupContext->getGlobalValueNumberingMap().tryGetValue(IRInstKey{ user }, existingVal))
{
addToWorkList(user, existingVal);
}
@@ -7075,9 +7075,9 @@ namespace Slang
}
else if (auto constInst = as<IRConstant>(this))
{
- module->getDeduplicationContext()->getConstantMap().Remove(IRConstantKey{ constInst });
+ module->getDeduplicationContext()->getConstantMap().remove(IRConstantKey{ constInst });
}
- module->getDeduplicationContext()->getInstReplacementMap().Remove(this);
+ module->getDeduplicationContext()->getInstReplacementMap().remove(this);
}
removeArguments();
removeAndDeallocateAllDecorationsAndChildren();