Repository: carbon-language/carbon-lang
File: toolchain/sem_ir/dump.cpp (C++)

Code before:
      complete_id.has_value()) {
    out << "\ncomplete: " << Dump(file, complete_id);
  }
  return out.TakeStr();
}

LLVM_DUMP_METHOD auto Dump(const File& file, FunctionId function_id)
    -> std::string {
  RawStringOstream out;
  out << function_id;
  if (function_id.has_value()) {
    const auto& function = file.functions().Get(function_id);
    out << ": " << function << DumpNameIfValid(file, function.name_id);
  }
  return out.TakeStr();
}

LLVM_DUMP_METHOD auto Dump(const File& file, GenericId generic_id)
    -> std::string {
  RawStringOstream out;
  out << DumpGenericSummary(file, generic_id);
  if (!generic_id.has_value()) {
    return out.TakeStr();
  }
  const auto& generic = file.generics().Get(generic_id);
  out << '\n' << Dump(file, generic.bindings_id);
  if (generic.decl_block_id.has_value()) {
    out << "\ngeneric decl block: " << Dump(file, generic.decl_block_id);
  }
  if (generic.definition_block_id.has_value()) {
    out << "\ngeneric definition block: "
        << Dump(file, generic.definition_block_id);
  }
  return out.TakeStr();
}

LLVM_DUMP_METHOD auto Dump(const File& file, ImplId impl_id) -> std::string {
  RawStringOstream out;
  out << impl_id;
  if (!impl_id.has_value()) {
    return out.TakeStr();
  }
  const auto& impl = file.impls().Get(impl_id);
  out << ": " << impl << '\n'
      << "  - interface_id: " << Dump(file, impl.interface.interface_id) << '\n'
      << "  - specific_id: "
      << DumpSpecificSummary(file, impl.interface.specific_id);
  if (impl.interface.specific_id.has_value()) {
    auto inst_block_id =
        file.specifics().Get(impl.interface.specific_id).args_id;
    out << '\n' << Dump(file, inst_block_id);

Review comment (suggestion):
```suggestion
  out << "\nbindings block: " << Dump(file, generic.bindings_id);
```

Code after:
      complete_id.has_value()) {
    out << "\ncomplete: " << Dump(file, complete_id);
  }
  return out.TakeStr();
}

LLVM_DUMP_METHOD auto Dump(const File& file, FunctionId function_id)
    -> std::string {
  RawStringOstream out;
  out << function_id;
  if (function_id.has_value()) {
    const auto& function = file.functions().Get(function_id);
    out << ": " << function << DumpNameIfValid(file, function.name_id);
  }
  return out.TakeStr();
}

LLVM_DUMP_METHOD auto Dump(const File& file, GenericId generic_id)
    -> std::string {
  RawStringOstream out;
  out << DumpGenericSummary(file, generic_id);
  if (!generic_id.has_value()) {
    return out.TakeStr();
  }
  const auto& generic = file.generics().Get(generic_id);
  out << "\nbindings block: " << Dump(file, generic.bindings_id);
  if (generic.decl_block_id.has_value()) {
    out << "\ngeneric decl block: " << Dump(file, generic.decl_block_id);
  }
  if (generic.definition_block_id.has_value()) {
    out << "\ngeneric definition block: "
        << Dump(file, generic.definition_block_id);
  }
  return out.TakeStr();
}

LLVM_DUMP_METHOD auto Dump(const File& file, ImplId impl_id) -> std::string {
  RawStringOstream out;
  out << impl_id;
  if (!impl_id.has_value()) {
    return out.TakeStr();
  }
  const auto& impl = file.impls().Get(impl_id);
  out << ": " << impl << '\n'
      << "  - interface_id: " << Dump(file, impl.interface.interface_id) << '\n'
      << "  - specific_id: "
      << DumpSpecificSummary(file, impl.interface.specific_id);
  if (impl.interface.specific_id.has_value()) {
    auto inst_block_id =
        file.specifics().Get(impl.interface.specific_id).args_id;
    out << '\n' << Dump(file, inst_block_id);