Skip to content

Commit 2355cb4

Browse files
committed
Sema: Move -debug-generic-signatures behavior to TypeCheckDeclPrimary.cpp
1 parent 8e7edb2 commit 2355cb4

File tree

6 files changed

+100
-94
lines changed

6 files changed

+100
-94
lines changed

include/swift/Basic/LangOptions.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,10 @@ namespace swift {
790790
/// Debug the generic signatures computed by the generic signature builder.
791791
bool DebugGenericSignatures = false;
792792

793+
/// If this is set, we skip the inverse transform and print explicit
794+
/// Copyable/Escapable requirements in the above.
795+
bool DebugInverseRequirements = false;
796+
793797
/// Whether we are debugging the constraint solver.
794798
///
795799
/// This option enables verbose debugging output from the constraint

include/swift/Option/FrontendOptions.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,9 @@ def disable_round_trip_debug_types : Flag<["-"], "disable-round-trip-debug-types
440440
def debug_generic_signatures : Flag<["-"], "debug-generic-signatures">,
441441
HelpText<"Debug generic signatures">;
442442

443+
def debug_inverse_requirements : Flag<["-"], "debug-inverse-requirements">,
444+
HelpText<"Print real requirements in -debug_generic_signatures output">;
445+
443446
def debug_forbid_typecheck_prefix : Separate<["-"], "debug-forbid-typecheck-prefix">,
444447
HelpText<"Triggers llvm fatal_error if typechecker tries to typecheck a decl "
445448
"with the provided prefix name">;

lib/AST/ASTPrinter.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2630,9 +2630,6 @@ void PrintAST::printDeclGenericRequirements(GenericContext *decl) {
26302630
if (parentSig && parentSig->isEqual(genericSig))
26312631
return;
26322632

2633-
SmallVector<Type, 2> genericParams;
2634-
InverseRequirement::enumerateDefaultedParams(decl, genericParams);
2635-
26362633
Printer.printStructurePre(PrintStructureKind::DeclGenericParameterClause);
26372634
printGenericSignature(genericSig,
26382635
PrintRequirements | PrintInverseRequirements,

0 commit comments

Comments
 (0)