id_kind.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. ClassId,
  32. CompileTimeBindIndex,
  33. ConstantId,
  34. CustomLayoutId,
  35. DeclInstBlockId,
  36. DestInstId,
  37. ElementIndex,
  38. EntityNameId,
  39. ExprRegionId,
  40. FacetTypeId,
  41. FloatKind,
  42. FunctionId,
  43. GenericId,
  44. ImplId,
  45. ImportIRId,
  46. ImportIRInstId,
  47. InstBlockId,
  48. InstId,
  49. InterfaceId,
  50. IntKind,
  51. LabelId,
  52. LibraryNameId,
  53. LocId,
  54. MetaInstId,
  55. NameId,
  56. NameScopeId,
  57. SpecificId,
  58. SpecificInterfaceId,
  59. StructTypeFieldsId,
  60. TypeInstId,
  61. VtableId>;
  62. // clang-format on
  63. } // namespace Carbon::SemIR
  64. #endif // CARBON_TOOLCHAIN_SEM_IR_ID_KIND_H_