diff options
Diffstat (limited to 'source/slang/slang-check-decl.cpp')
| -rw-r--r-- | source/slang/slang-check-decl.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp index 6385e5f57..8c9ca2936 100644 --- a/source/slang/slang-check-decl.cpp +++ b/source/slang/slang-check-decl.cpp @@ -2006,11 +2006,11 @@ namespace Slang // Once things are done, we will install the satisfying values // into the witness table for the requirements. // - for( auto p : mapRequiredToSatisfyingAccessorDeclRef ) + for( const auto& [key, value] : mapRequiredToSatisfyingAccessorDeclRef ) { witnessTable->add( - p.key.getDecl(), - RequirementWitness(p.value)); + key.getDecl(), + RequirementWitness(value)); } // // Note: the property declaration itself isn't something that @@ -2559,10 +2559,10 @@ namespace Slang // if (auto typeParamDecl = as<DeclRefType>(constraintDecl->sub.type)->getDeclRef().as<GenericTypeParamDecl>().getDecl()) { - auto synTypeParamDecl = mapOrigToSynTypeParams[typeParamDecl]; + auto synTypeParamDecl = mapOrigToSynTypeParams.getValue(typeParamDecl); // Construct a DeclRefExpr from the type parameter. - auto synTypeParamDeclRef = makeDeclRef(synTypeParamDecl.getValue()); + auto synTypeParamDeclRef = makeDeclRef(synTypeParamDecl); auto synTypeParamDeclRefExpr = m_astBuilder->create<VarExpr>(); synTypeParamDeclRefExpr->declRef = synTypeParamDeclRef; @@ -3262,9 +3262,9 @@ namespace Slang // difference between our synthetic property and a hand-written // one with the same behavior. // - for(auto p : mapRequiredAccessorToSynAccessor) + for(auto& [key, value] : mapRequiredAccessorToSynAccessor) { - witnessTable->add(p.key.getDecl(), RequirementWitness(makeDeclRef(p.value))); + witnessTable->add(key.getDecl(), RequirementWitness(makeDeclRef(value))); } witnessTable->add(requiredMemberDeclRef.getDecl(), RequirementWitness(makeDeclRef(synPropertyDecl))); @@ -3531,7 +3531,6 @@ namespace Slang { case SynthesisPattern::AllInductive: { - int paramIndex = 0; for (auto arg : synArgs) { auto memberExpr = m_astBuilder->create<MemberExpr>(); @@ -3541,8 +3540,6 @@ namespace Slang memberExpr->name = varMember->getName(); paramFields.add(memberExpr); inductiveArgMask.add(true); - - paramIndex++; } break; } @@ -5460,9 +5457,8 @@ namespace Slang _addTargetModifiers(newDecl, newTargets); bool hasConflict = false; - for (auto& pair : newTargets) + for (auto& [target, value] : newTargets) { - Name* target = pair.key; auto found = currentTargets.tryGetValue(target); if (found) { @@ -6666,10 +6662,10 @@ namespace Slang void SharedSemanticsContext::_addCandidateExtensionsFromModule(ModuleDecl* moduleDecl) { - for( auto& entry : moduleDecl->mapTypeToCandidateExtensions ) + for( auto& [entryKey, entryValue] : moduleDecl->mapTypeToCandidateExtensions ) { - auto& list = _getCandidateExtensionList(entry.key, m_mapTypeDeclToCandidateExtensions); - list.addRange(entry.value->candidateExtensions); + auto& list = _getCandidateExtensionList(entryKey, m_mapTypeDeclToCandidateExtensions); + list.addRange(entryValue->candidateExtensions); } } |
