Skip to content

Commit 5bff2a0

Browse files
committed
RequirementMachine: Rename RewritePath::getRulesInEmptyContext() to findRulesAppearingOnceInEmptyContext()
1 parent deaeb36 commit 5bff2a0

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

lib/AST/RequirementMachine/HomotopyReduction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ void RewriteSystem::propagateRedundantRequirementIDs() {
136136
continue;
137137

138138
MutableTerm lhs(rule.getLHS());
139-
for (auto ruleID : rewritePath.getRulesInEmptyContext(lhs, *this)) {
139+
for (auto ruleID : rewritePath.findRulesAppearingOnceInEmptyContext(lhs, *this)) {
140140
auto &replacement = Rules[ruleID];
141141
if (!replacement.isPermanent()) {
142142
// If the replacement rule already has a requirementID, overwrite

lib/AST/RequirementMachine/RewriteLoop.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ bool RewritePath::replaceRuleWithPath(unsigned ruleID,
345345
}
346346

347347
SmallVector<unsigned, 1>
348-
RewritePath::getRulesInEmptyContext(const MutableTerm &term,
349-
const RewriteSystem &system) const {
348+
RewritePath::findRulesAppearingOnceInEmptyContext(const MutableTerm &term,
349+
const RewriteSystem &system) const {
350350
// Rules appearing in empty context (possibly more than once).
351351
llvm::SmallDenseSet<unsigned, 2> rulesInEmptyContext;
352352
// The number of times each rule appears (with or without context).
@@ -485,7 +485,8 @@ void RewriteLoop::recompute(const RewriteSystem &system) {
485485
evaluator.apply(step, system);
486486
}
487487

488-
RulesInEmptyContext = Path.getRulesInEmptyContext(Basepoint, system);
488+
RulesInEmptyContext =
489+
Path.findRulesAppearingOnceInEmptyContext(Basepoint, system);
489490
}
490491

491492
/// A rewrite rule is redundant if it appears exactly once in a loop

lib/AST/RequirementMachine/RewriteLoop.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,9 @@ class RewritePath {
411411

412412
bool replaceRuleWithPath(unsigned ruleID, const RewritePath &path);
413413

414-
SmallVector<unsigned, 1> getRulesInEmptyContext(const MutableTerm &term,
415-
const RewriteSystem &system) const;
414+
SmallVector<unsigned, 1>
415+
findRulesAppearingOnceInEmptyContext(const MutableTerm &term,
416+
const RewriteSystem &system) const;
416417

417418
void invert();
418419

0 commit comments

Comments
 (0)