id_kind.h 1.7 KB

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