id_kind.h 1.6 KB

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