id_kind.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. #ifndef CARBON_TOOLCHAIN_SEM_IR_ID_KIND_H_
  5. #define CARBON_TOOLCHAIN_SEM_IR_ID_KIND_H_
  6. #include "common/type_enum.h"
  7. #include "toolchain/base/int.h"
  8. #include "toolchain/sem_ir/ids.h"
  9. namespace Carbon::SemIR {
  10. // An enum of all the ID types used as instruction operands.
  11. //
  12. // As instruction operands, the types listed here can appear as fields of typed
  13. // instructions (`toolchain/sem_ir/typed_insts.h`) and must implement the
  14. // `FromRaw` and `ToRaw` protocol in `Inst`. In most cases this is done by
  15. // inheriting from `IdBase` or `IndexBase`.
  16. //
  17. // clang-format off: We want one per line.
  18. using IdKind = TypeEnum<
  19. // From base/value_store.h.
  20. FloatId,
  21. IntId,
  22. RealId,
  23. StringLiteralValueId,
  24. // From sem_ir/ids.h.
  25. AbsoluteInstBlockId,
  26. AbsoluteInstId,
  27. AnyRawId,
  28. AssociatedConstantId,
  29. BoolValue,
  30. CallParamIndex,
  31. CharId,
  32. ClassId,
  33. CompileTimeBindIndex,
  34. ConstantId,
  35. CppOverloadSetId,
  36. CustomLayoutId,
  37. DeclInstBlockId,
  38. DestInstId,
  39. ElementIndex,
  40. EntityNameId,
  41. ExprRegionId,
  42. FacetTypeId,
  43. FloatKind,
  44. FunctionId,
  45. GenericId,
  46. ImplId,
  47. ImportIRId,
  48. ImportIRInstId,
  49. InstBlockId,
  50. InstId,
  51. InterfaceId,
  52. IntKind,
  53. LabelId,
  54. LibraryNameId,
  55. LocId,
  56. MetaInstId,
  57. NameId,
  58. NameScopeId,
  59. NamedConstraintId,
  60. SpecificId,
  61. SpecificInterfaceId,
  62. StructTypeFieldsId,
  63. TypeInstId,
  64. VtableId>;
  65. // clang-format on
  66. } // namespace Carbon::SemIR
  67. #endif // CARBON_TOOLCHAIN_SEM_IR_ID_KIND_H_