Skip to content

Commit 4d5e641

Browse files
committed
RequirementMachine: Store the rewrite system in the property map
1 parent 480bb08 commit 4d5e641

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lib/AST/RequirementMachine/PropertyMap.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ class PropertyBag {
139139
/// Out-of-line methods are documented in PropertyMap.cpp.
140140
class PropertyMap {
141141
RewriteContext &Context;
142+
RewriteSystem &System;
142143
std::vector<PropertyBag *> Entries;
143144
Trie<PropertyBag *, MatchKind::Longest> Trie;
144145

@@ -156,10 +157,11 @@ class PropertyMap {
156157
PropertyMap &operator=(PropertyMap &&) = delete;
157158

158159
public:
159-
explicit PropertyMap(RewriteContext &ctx,
160-
const ProtocolGraph &protos)
161-
: Context(ctx), Protos(protos) {
162-
Debug = ctx.getDebugOptions();
160+
explicit PropertyMap(RewriteSystem &system)
161+
: Context(system.getRewriteContext()),
162+
System(system),
163+
Protos(system.getProtocols()) {
164+
Debug = Context.getDebugOptions();
163165
}
164166

165167
~PropertyMap();

lib/AST/RequirementMachine/RequirementMachine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ void RequirementMachine::dump(llvm::raw_ostream &out) const {
371371
}
372372

373373
RequirementMachine::RequirementMachine(RewriteContext &ctx)
374-
: Context(ctx), System(ctx), Map(ctx, System.getProtocols()) {
374+
: Context(ctx), System(ctx), Map(System) {
375375
auto &langOpts = ctx.getASTContext().LangOpts;
376376
Dump = langOpts.DumpRequirementMachine;
377377
RequirementMachineStepLimit = langOpts.RequirementMachineStepLimit;

0 commit comments

Comments
 (0)