mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Remove some save-and-restores
An awful pattern we use throughout the compiler is to save and restore global flags just for little things. In this case, it was just to turn on some extra options in AST printing for type variables. The kicker is that the ASTDumper doesn't even respect this flag. Add this as a PrintOption and remove the offending save-and-restores. This doesn't quite get them all: we appear to have productized this pattern in the REPL.
This commit is contained in:
@@ -2242,11 +2242,13 @@ void ConstraintSystem::resolveOverload(ConstraintLocator *locator,
|
||||
}
|
||||
|
||||
if (getASTContext().TypeCheckerOpts.DebugConstraintSolver) {
|
||||
PrintOptions PO;
|
||||
PO.PrintTypesForDebugging = true;
|
||||
auto &log = getASTContext().TypeCheckerDebug->getStream();
|
||||
log.indent(solverState ? solverState->depth * 2 : 2)
|
||||
<< "(overload set choice binding "
|
||||
<< boundType->getString() << " := "
|
||||
<< refType->getString() << ")\n";
|
||||
<< boundType->getString(PO) << " := "
|
||||
<< refType->getString(PO) << ")\n";
|
||||
}
|
||||
|
||||
// If this overload is disfavored, note that.
|
||||
|
||||
Reference in New Issue
Block a user