Skip to content

Commit b138c76

Browse files
committed
RequirementMachine: Add DebugFlags::PropertyMap
1 parent 4f3d05f commit b138c76

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

lib/AST/RequirementMachine/Debug.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,30 @@ enum class DebugFlags : unsigned {
3232
/// Print debug output from the Knuth-Bendix algorithm.
3333
Completion = (1<<3),
3434

35+
/// Print debug output from property map construction.
36+
PropertyMap = (1<<4),
37+
3538
/// Print debug output when unifying concrete types in the property map.
36-
ConcreteUnification = (1<<4),
39+
ConcreteUnification = (1<<5),
3740

3841
/// Print debug output when concretizing nested types in the property map.
39-
ConcretizeNestedTypes = (1<<5),
42+
ConcretizeNestedTypes = (1<<6),
4043

4144
/// Print debug output when inferring conditional requirements in the
4245
/// property map.
43-
ConditionalRequirements = (1<<6),
46+
ConditionalRequirements = (1<<7),
4447

4548
/// Print debug output from the homotopy reduction algorithm.
46-
HomotopyReduction = (1<<7),
49+
HomotopyReduction = (1<<8),
4750

4851
/// Print debug output from the minimal conformances algorithm.
49-
MinimalConformances = (1<<8),
52+
MinimalConformances = (1<<9),
5053

5154
/// Print debug output from the protocol dependency graph.
52-
ProtocolDependencies = (1<<9),
55+
ProtocolDependencies = (1<<10),
5356

5457
/// Print debug output from generic signature minimization.
55-
Minimization = (1<<10),
58+
Minimization = (1<<11),
5659
};
5760

5861
using DebugOptions = OptionSet<DebugFlags>;

lib/AST/RequirementMachine/PropertyMap.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,12 @@ void PropertyMap::clear() {
330330
std::pair<CompletionResult, unsigned>
331331
PropertyMap::buildPropertyMap(unsigned maxIterations,
332332
unsigned maxDepth) {
333+
if (System.getDebugOptions().contains(DebugFlags::PropertyMap)) {
334+
llvm::dbgs() << "-------------------------\n";
335+
llvm::dbgs() << "- Building property map -\n";
336+
llvm::dbgs() << "-------------------------\n";
337+
}
338+
333339
clear();
334340

335341
struct Property {

lib/AST/RequirementMachine/RewriteContext.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ static DebugOptions parseDebugFlags(StringRef debugFlags) {
3131
.Case("add", DebugFlags::Add)
3232
.Case("merge", DebugFlags::Merge)
3333
.Case("completion", DebugFlags::Completion)
34+
.Case("property-map", DebugFlags::PropertyMap)
3435
.Case("concrete-unification", DebugFlags::ConcreteUnification)
3536
.Case("concretize-nested-types", DebugFlags::ConcretizeNestedTypes)
3637
.Case("conditional-requirements", DebugFlags::ConditionalRequirements)

0 commit comments

Comments
 (0)