lib/AST/RequirementMachine/RewriteLoop.cpp
void RewriteStep::dump(llvm::raw_ostream &out,
                       RewritePathEvaluator &evaluator,
                       const RewriteSystem &system) const {
  switch (Kind) {
  case Rule: {
    auto result = evaluator.applyRewriteRule(*this, system);

    if (!result.prefix.empty()) {
      out << result.prefix;
      out << ".";
    }
    out << "(" << result.lhs << " => " << result.rhs << ")";
    if (!result.suffix.empty()) {
      out << ".";
      out << result.suffix;
    }

    break;
  }
  case AdjustConcreteType: {
    auto pair = evaluator.applyAdjustment(*this, system);

    out << "(σ";
    out << (Inverse ? " - " : " + ");
    out << pair.first << ")";

    if (!pair.second.empty())
      out << "." << pair.second;

    break;
  }
  case Shift: {
    evaluator.applyShift(*this, system);

    out << (Inverse ? "B>A" : "A>B");
    break;
  }
  case Decompose: {
    evaluator.applyDecompose(*this, system);

    out << (Inverse ? "Compose(" : "Decompose(");
    out << Arg << ")";
    break;
  }
  case Relation: {
    auto result = evaluator.applyRelation(*this, system);

    if (!result.prefix.empty()) {
      out << result.prefix;
      out << ".";
    }
    out << "(" << result.lhs << " =>> " << result.rhs << ")";
    if (!result.suffix.empty()) {
      out << ".";
      out << result.suffix;
    }

    break;
  }
  }
}
/// Dumps the rewrite step that was applied to \p term. Mutates \p term to
/// reflect the application of the rule.
Dumps the rewrite step that was applied to \p term. Mutates \p term to
reflect the application of the rule.
Dumps the rewrite step that was applied to \ p term . Mutates \ p term to reflect the application of the rule .
void RewriteStep::dump(llvm::raw_ostream &out,
                       RewritePathEvaluator &evaluator,
                       const RewriteSystem &system) const {
  switch (Kind) {
  case Rule: {
    auto result = evaluator.applyRewriteRule(*this, system);
    if (!result.prefix.empty()) {
      out << result.prefix;
      out << ".";
    }
    out << "(" << result.lhs << " => " << result.rhs << ")";
    if (!result.suffix.empty()) {
      out << ".";
      out << result.suffix;
    }
    break;
  }
  case AdjustConcreteType: {
    auto pair = evaluator.applyAdjustment(*this, system);
    out << "(σ";
    out << (Inverse ? " - " : " + ");
    out << pair.first << ")";
    if (!pair.second.empty())
      out << "." << pair.second;
    break;
  }
  case Shift: {
    evaluator.applyShift(*this, system);
    out << (Inverse ? "B>A" : "A>B");
    break;
  }
  case Decompose: {
    evaluator.applyDecompose(*this, system);
    out << (Inverse ? "Compose(" : "Decompose(");
    out << Arg << ")";
    break;
  }
  case Relation: {
    auto result = evaluator.applyRelation(*this, system);
    if (!result.prefix.empty()) {
      out << result.prefix;
      out << ".";
    }
    out << "(" << result.lhs << " =>> " << result.rhs << ")";
    if (!result.suffix.empty()) {
      out << ".";
      out << result.suffix;
    }
    break;
  }
  }
}
void RewriteStep :: dump ( llvm :: raw_ostream & out , RewritePathEvaluator & evaluator , const RewriteSystem & system ) const { switch ( Kind ) { case Rule : { auto result = evaluator . applyRewriteRule ( * this , system ) ; if ( ! result . prefix . empty ( ) ) { out << result . prefix ; out << " " ; } out << " " << result . lhs << " " << result . rhs << " " ; if ( ! result . suffix . empty ( ) ) { out << " " ; out << result . suffix ; } break ; } case AdjustConcreteType : { auto pair = evaluator . applyAdjustment ( * this , system ) ; out << " ; out << ( Inverse ? " " : " " ) ; out << pair . first << " " ; if ( ! pair . second . empty ( ) ) out << " " << pair . second ; break ; } case Shift : { evaluator . applyShift ( * this , system ) ; out << ( Inverse ? " " : " " ) ; break ; } case Decompose : { evaluator . applyDecompose ( * this , system ) ; out << ( Inverse ? " " : " " ) ; out << Arg << " " ; break ; } case Relation : { auto result = evaluator . applyRelation ( * this , system ) ; if ( ! result . prefix . empty ( ) ) { out << result . prefix ; out << " " ; } out << " " << result . lhs << " " << result . rhs << " " ; if ( ! result . suffix . empty ( ) ) { out << " " ; out << result . suffix ; } break ; } } }
Dumps the rewrite step that was applied to \p term.
Dumps the rewrite step that was applied to \ p term .