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

Code before:
#include "toolchain/lex/dump.h"

#include <string>

#include "common/check.h"
#include "common/raw_string_ostream.h"
#include "toolchain/check/context.h"
#include "toolchain/lex/tokenized_buffer.h"
#include "toolchain/parse/dump.h"
#include "toolchain/parse/tree.h"
#include "toolchain/sem_ir/dump.h"
#include "toolchain/sem_ir/file.h"

namespace Carbon::Check {

LLVM_DUMP_METHOD static auto Dump(const Context& context, Lex::TokenIndex token)
    -> std::string {
  return Parse::Dump(context.parse_tree(), token);
}

LLVM_DUMP_METHOD static auto Dump(const Context& context, Parse::NodeId node_id)
    -> std::string {
  return Parse::Dump(context.parse_tree(), node_id);
}

LLVM_DUMP_METHOD static auto Dump(const Context& context, int32_t inst_id)
    -> std::string {
  return SemIR::Dump(context.sem_ir(), inst_id);
}

LLVM_DUMP_METHOD static auto Dump(const Context& context,
                                  SemIR::ClassId class_id) -> std::string {
  return SemIR::Dump(context.sem_ir(), class_id);
}

LLVM_DUMP_METHOD static auto Dump(const Context& context,
                                  SemIR::ConstantId const_id) -> std::string {
  return SemIR::Dump(context.sem_ir(), const_id);
}

LLVM_DUMP_METHOD static auto Dump(const Context& context,
                                  SemIR::EntityNameId entity_name_id)
    -> std::string {
  return SemIR::Dump(context.sem_ir(), entity_name_id);
}

LLVM_DUMP_METHOD static auto Dump(const Context& context,
                                  SemIR::FacetTypeId facet_type_id)
    -> std::string {
  return SemIR::Dump(context.sem_ir(), facet_type_id);
}

Review comment (suggestion):
Maybe?
```suggestion
LLVM_DUMP_METHOD static auto DumpInstId(const Context& context, int32_t inst_id)
```

Code after:
#include "toolchain/lex/dump.h"

#include <string>

#include "common/check.h"
#include "common/raw_string_ostream.h"
#include "toolchain/check/context.h"
#include "toolchain/lex/tokenized_buffer.h"
#include "toolchain/parse/dump.h"
#include "toolchain/parse/tree.h"
#include "toolchain/sem_ir/dump.h"
#include "toolchain/sem_ir/file.h"

namespace Carbon::Check {

LLVM_DUMP_METHOD static auto Dump(const Context& context, Lex::TokenIndex token)
    -> std::string {
  return Parse::Dump(context.parse_tree(), token);
}

LLVM_DUMP_METHOD static auto Dump(const Context& context, Parse::NodeId node_id)
    -> std::string {
  return Parse::Dump(context.parse_tree(), node_id);
}

LLVM_DUMP_METHOD static auto Dump(const Context& context,
                                  SemIR::ClassId class_id) -> std::string {
  return SemIR::Dump(context.sem_ir(), class_id);
}

LLVM_DUMP_METHOD static auto Dump(const Context& context,
                                  SemIR::ConstantId const_id) -> std::string {
  return SemIR::Dump(context.sem_ir(), const_id);
}

LLVM_DUMP_METHOD static auto Dump(const Context& context,
                                  SemIR::EntityNameId entity_name_id)
    -> std::string {
  return SemIR::Dump(context.sem_ir(), entity_name_id);
}

LLVM_DUMP_METHOD static auto Dump(const Context& context,
                                  SemIR::FacetTypeId facet_type_id)
    -> std::string {
  return SemIR::Dump(context.sem_ir(), facet_type_id);
}

LLVM_DUMP_METHOD static auto Dump(const Context& context,
                                  SemIR::FunctionId function_id)
    -> std::string {
  return SemIR::Dump(context.sem_ir(), function_id);