Skip to content

Commit fcd6bc0

Browse files
committed
Sema: Remove Solution::PackElementGenericEnvironments
1 parent 0518b76 commit fcd6bc0

File tree

4 files changed

+1
-22
lines changed

4 files changed

+1
-22
lines changed

include/swift/Sema/ConstraintSystem.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,10 +1549,6 @@ class Solution {
15491549
llvm::DenseMap<PackElementExpr *, PackExpansionExpr *>
15501550
PackEnvironments;
15511551

1552-
/// The outer pack element generic environment to use when dealing with nested
1553-
/// pack iteration (see \c getPackElementEnvironment).
1554-
llvm::SmallVector<GenericEnvironment *> PackElementGenericEnvironments;
1555-
15561552
/// The locators of \c Defaultable constraints whose defaults were used.
15571553
llvm::DenseSet<ConstraintLocator *> DefaultedConstraints;
15581554

@@ -2883,9 +2879,6 @@ class ConstraintSystem {
28832879
/// FIXME: Remove this.
28842880
unsigned numFixes;
28852881

2886-
/// The length of \c PackElementGenericEnvironments.
2887-
unsigned numPackElementGenericEnvironments;
2888-
28892882
/// The length of \c DefaultedConstraints.
28902883
unsigned numDefaultedConstraints;
28912884

lib/Sema/CSGen.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4945,6 +4945,7 @@ bool ConstraintSystem::generateConstraints(
49454945
// Cache the outer generic environment, if it exists.
49464946
if (target.getPackElementEnv()) {
49474947
PackElementGenericEnvironments.push_back(target.getPackElementEnv());
4948+
ASSERT(!isRecordingChanges() && "Need to record a change");
49484949
}
49494950

49504951
// For a for-each statement, generate constraints for the pattern, where

lib/Sema/CSSolver.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,6 @@ Solution ConstraintSystem::finalize() {
264264
for (const auto &packEnv : PackEnvironments)
265265
solution.PackEnvironments.insert(packEnv);
266266

267-
for (const auto &packEltGenericEnv : PackElementGenericEnvironments)
268-
solution.PackElementGenericEnvironments.push_back(packEltGenericEnv);
269-
270267
for (const auto &synthesized : SynthesizedConformances) {
271268
solution.SynthesizedConformances.insert(synthesized);
272269
}
@@ -349,12 +346,6 @@ void ConstraintSystem::applySolution(const Solution &solution) {
349346
addPackEnvironment(packEnvironment.first, packEnvironment.second);
350347
}
351348

352-
// Register the solutions's pack element generic environments.
353-
for (auto &packElementGenericEnvironment :
354-
solution.PackElementGenericEnvironments) {
355-
PackElementGenericEnvironments.push_back(packElementGenericEnvironment);
356-
}
357-
358349
// Register the defaulted type variables.
359350
DefaultedConstraints.insert(solution.DefaultedConstraints.begin(),
360351
solution.DefaultedConstraints.end());
@@ -672,7 +663,6 @@ ConstraintSystem::SolverScope::SolverScope(ConstraintSystem &cs)
672663

673664
numTypeVariables = cs.TypeVariables.size();
674665
numFixes = cs.Fixes.size();
675-
numPackElementGenericEnvironments = cs.PackElementGenericEnvironments.size();
676666
numDefaultedConstraints = cs.DefaultedConstraints.size();
677667
numAddedNodeTypes = cs.addedNodeTypes.size();
678668
numAddedKeyPathComponentTypes = cs.addedKeyPathComponentTypes.size();
@@ -729,10 +719,6 @@ ConstraintSystem::SolverScope::~SolverScope() {
729719
// constraints introduced by the current scope.
730720
cs.solverState->rollback(this);
731721

732-
// Remove any pack element generic environments.
733-
truncate(cs.PackElementGenericEnvironments,
734-
numPackElementGenericEnvironments);
735-
736722
// Remove any defaulted type variables.
737723
truncate(cs.DefaultedConstraints, numDefaultedConstraints);
738724

lib/Sema/ConstraintSystem.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4473,7 +4473,6 @@ size_t Solution::getTotalMemory() const {
44734473
OpenedPackExpansionTypes.getMemorySize() +
44744474
PackExpansionEnvironments.getMemorySize() +
44754475
size_in_bytes(PackEnvironments) +
4476-
PackElementGenericEnvironments.size() +
44774476
(DefaultedConstraints.size() * sizeof(void *)) +
44784477
nodeTypes.getMemorySize() +
44794478
keyPathComponentTypes.getMemorySize() +

0 commit comments

Comments
 (0)