mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
I'm trying to make the offsetting a little easier to understand, and also get a better `requires` structure on calls. The second is for an attempt to refactor the `Formatter` API, but also changing the `InstId` `derived_from` requires seems helpful for clarity on what's really happening.
69 lines
1.6 KiB
C++
69 lines
1.6 KiB
C++
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
#ifndef CARBON_TOOLCHAIN_SEM_IR_ID_KIND_H_
|
|
#define CARBON_TOOLCHAIN_SEM_IR_ID_KIND_H_
|
|
|
|
#include "common/type_enum.h"
|
|
#include "toolchain/base/int.h"
|
|
#include "toolchain/sem_ir/ids.h"
|
|
|
|
namespace Carbon::SemIR {
|
|
|
|
// An enum of all the ID types used as instruction operands.
|
|
//
|
|
// As instruction operands, the types listed here can appear as fields of typed
|
|
// instructions (`toolchain/sem_ir/typed_insts.h`) and must implement the
|
|
// `FromRaw` and `ToRaw` protocol in `Inst`. In most cases this is done by
|
|
// inheriting from `IdBase` or `IndexBase`.
|
|
//
|
|
// clang-format off: We want one per line.
|
|
using IdKind = TypeEnum<
|
|
// From base/value_store.h.
|
|
FloatId,
|
|
IntId,
|
|
RealId,
|
|
StringLiteralValueId,
|
|
// From sem_ir/ids.h.
|
|
AbsoluteInstBlockId,
|
|
AbsoluteInstId,
|
|
AnyRawId,
|
|
AssociatedConstantId,
|
|
BoolValue,
|
|
CallParamIndex,
|
|
ClassId,
|
|
CompileTimeBindIndex,
|
|
ConstantId,
|
|
DeclInstBlockId,
|
|
DestInstId,
|
|
ElementIndex,
|
|
EntityNameId,
|
|
ExprRegionId,
|
|
FacetTypeId,
|
|
FloatKind,
|
|
FunctionId,
|
|
GenericId,
|
|
ImplId,
|
|
ImportIRId,
|
|
ImportIRInstId,
|
|
InstBlockId,
|
|
InstId,
|
|
InterfaceId,
|
|
IntKind,
|
|
LabelId,
|
|
LibraryNameId,
|
|
LocId,
|
|
MetaInstId,
|
|
NameId,
|
|
NameScopeId,
|
|
SpecificId,
|
|
SpecificInterfaceId,
|
|
StructTypeFieldsId,
|
|
TypeInstId>;
|
|
// clang-format on
|
|
|
|
} // namespace Carbon::SemIR
|
|
|
|
#endif // CARBON_TOOLCHAIN_SEM_IR_ID_KIND_H_
|