From 7b7c095b37e85ca3a8f55eff1c3d9643d467b8e0 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 25 Apr 2023 10:43:29 -0400 Subject: 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. --- source/slang/slang-emit-c-like.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'source/slang/slang-emit-c-like.cpp') diff --git a/source/slang/slang-emit-c-like.cpp b/source/slang/slang-emit-c-like.cpp index 166c131d5..9dacaa4d4 100644 --- a/source/slang/slang-emit-c-like.cpp +++ b/source/slang/slang-emit-c-like.cpp @@ -82,7 +82,7 @@ Index LocationTracker::getValue(Kind kind, IRInst* inst, IRDecoration* decoratio auto& nextValue = m_nextValueForKind[Index(kind)]; const Location defaultLocation{kind, nextValue}; - const Location foundLocation = m_mapIRToLocations.GetOrAddValue(inst, defaultLocation); + const Location foundLocation = m_mapIRToLocations.getOrAddValue(inst, defaultLocation); // Increase if it was the default nextValue += Index(defaultLocation == foundLocation); @@ -314,7 +314,7 @@ List CLikeSourceEmitter::getSortedWitnessTableEntries(IRWi { auto reqEntry = cast(interfaceType->getOperand(i)); IRWitnessTableEntry* entry = nullptr; - if (witnessTableEntryDictionary.TryGetValue(reqEntry->getRequirementKey(), entry)) + if (witnessTableEntryDictionary.tryGetValue(reqEntry->getRequirementKey(), entry)) { sortedWitnessTableEntries.add(entry); } @@ -648,11 +648,11 @@ UInt CLikeSourceEmitter::getID(IRInst* value) auto& mapIRValueToID = m_mapIRValueToID; UInt id = 0; - if (mapIRValueToID.TryGetValue(value, id)) + if (mapIRValueToID.tryGetValue(value, id)) return id; id = allocateUniqueID(); - mapIRValueToID.Add(value, id); + mapIRValueToID.add(value, id); return id; } @@ -855,7 +855,7 @@ String CLikeSourceEmitter::_generateUniqueName(const UnownedStringSlice& name) String key = sb.ProduceString(); - UInt& countRef = m_uniqueNameCounters.GetOrAddValue(key, 0); + UInt& countRef = m_uniqueNameCounters.getOrAddValue(key, 0); const UInt count = countRef; countRef = count + 1; @@ -937,10 +937,10 @@ String CLikeSourceEmitter::generateName(IRInst* inst) String CLikeSourceEmitter::getName(IRInst* inst) { String name; - if(!m_mapInstToName.TryGetValue(inst, name)) + if(!m_mapInstToName.tryGetValue(inst, name)) { name = generateName(inst); - m_mapInstToName.Add(inst, name); + m_mapInstToName.add(inst, name); } return name; } @@ -3720,7 +3720,7 @@ void CLikeSourceEmitter::ensureGlobalInst(ComputeEmitActionsContext* ctx, IRInst // Have we already processed this instruction? EmitAction::Level existingLevel; - if(ctx->mapInstToLevel.TryGetValue(inst, existingLevel)) + if(ctx->mapInstToLevel.tryGetValue(inst, existingLevel)) { // If we've already emitted it suitably, // then don't worry about it. @@ -3734,17 +3734,17 @@ void CLikeSourceEmitter::ensureGlobalInst(ComputeEmitActionsContext* ctx, IRInst if(requiredLevel == EmitAction::Level::Definition) { - if(ctx->openInsts.Contains(inst)) + if(ctx->openInsts.contains(inst)) { SLANG_UNEXPECTED("circularity during codegen"); return; } - ctx->openInsts.Add(inst); + ctx->openInsts.add(inst); ensureInstOperandsRec(ctx, inst); - ctx->openInsts.Remove(inst); + ctx->openInsts.remove(inst); } ctx->mapInstToLevel[inst] = requiredLevel; -- cgit v1.2.3