dump.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. // This library contains functions to assist dumping objects to stderr during
  5. // interactive debugging. Functions named `Dump` are intended for direct use by
  6. // developers, and should use overload resolution to determine which will be
  7. // invoked. The debugger should do namespace resolution automatically. For
  8. // example:
  9. //
  10. // - lldb: `expr Dump(tokens, id)`
  11. // - gdb: `call Dump(tokens, id)`
  12. #ifndef CARBON_TOOLCHAIN_SEM_IR_DUMP_H_
  13. #define CARBON_TOOLCHAIN_SEM_IR_DUMP_H_
  14. #ifndef NDEBUG
  15. #include "toolchain/sem_ir/file.h"
  16. namespace Carbon::SemIR {
  17. auto Dump(const File& file, ClassId class_id) -> void;
  18. auto Dump(const File& file, ConstantId const_id) -> void;
  19. auto Dump(const File& file, EntityNameId entity_name_id) -> void;
  20. auto Dump(const File& file, FacetTypeId facet_type_id) -> void;
  21. auto Dump(const File& file, FunctionId function_id) -> void;
  22. auto Dump(const File& file, GenericId generic_id) -> void;
  23. auto Dump(const File& file, ImplId impl_id) -> void;
  24. auto Dump(const File& file, InstBlockId inst_block_id) -> void;
  25. auto Dump(const File& file, InstId inst_id) -> void;
  26. auto Dump(const File& file, InterfaceId interface_id) -> void;
  27. auto Dump(const File& file, NameId name_id) -> void;
  28. auto Dump(const File& file, NameScopeId name_scope_id) -> void;
  29. auto Dump(const File& file, SpecificId specific_id) -> void;
  30. auto Dump(const File& file, StructTypeFieldsId struct_type_fields_id) -> void;
  31. auto Dump(const File& file, TypeBlockId type_block_id) -> void;
  32. auto Dump(const File& file, TypeId type_id) -> void;
  33. } // namespace Carbon::SemIR
  34. #endif // NDEBUG
  35. #endif // CARBON_TOOLCHAIN_SEM_IR_DUMP_H_