id_kind.h 1.6 KB

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