mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 16:01:04 +01:00
Rename singleton InstId constants to TypeInstId (#5323)
These constant instructions are all TypeInstId already in their type, and this makes their names match. Change the name of MakeSingletonInstId as well and update its comment.
This commit is contained in:
@@ -77,7 +77,7 @@ struct NoReturn {
|
||||
};
|
||||
|
||||
// Constraint that a type is `bool`.
|
||||
using Bool = BuiltinType<BoolType::InstId>;
|
||||
using Bool = BuiltinType<BoolType::TypeInstId>;
|
||||
|
||||
// Constraint that requires the type to be a sized integer type.
|
||||
struct AnySizedInt {
|
||||
@@ -92,7 +92,8 @@ struct AnyInt {
|
||||
static auto Check(const File& sem_ir, ValidateState& state, TypeId type_id)
|
||||
-> bool {
|
||||
return AnySizedInt::Check(sem_ir, state, type_id) ||
|
||||
BuiltinType<IntLiteralType::InstId>::Check(sem_ir, state, type_id);
|
||||
BuiltinType<IntLiteralType::TypeInstId>::Check(sem_ir, state,
|
||||
type_id);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -100,7 +101,8 @@ struct AnyInt {
|
||||
struct AnyFloat {
|
||||
static auto Check(const File& sem_ir, ValidateState& state, TypeId type_id)
|
||||
-> bool {
|
||||
if (BuiltinType<LegacyFloatType::InstId>::Check(sem_ir, state, type_id)) {
|
||||
if (BuiltinType<LegacyFloatType::TypeInstId>::Check(sem_ir, state,
|
||||
type_id)) {
|
||||
return true;
|
||||
}
|
||||
return sem_ir.types().Is<FloatType>(type_id);
|
||||
@@ -108,14 +110,14 @@ struct AnyFloat {
|
||||
};
|
||||
|
||||
// Constraint that requires the type to be the type type.
|
||||
using Type = BuiltinType<TypeType::InstId>;
|
||||
using Type = BuiltinType<TypeType::TypeInstId>;
|
||||
|
||||
// Constraint that requires the type to be a type value, whose type is type
|
||||
// type. Also accepts symbolic constant value types.
|
||||
struct AnyType {
|
||||
static auto Check(const File& sem_ir, ValidateState& state, TypeId type_id)
|
||||
-> bool {
|
||||
if (BuiltinType<TypeType::InstId>::Check(sem_ir, state, type_id)) {
|
||||
if (BuiltinType<TypeType::TypeInstId>::Check(sem_ir, state, type_id)) {
|
||||
return true;
|
||||
}
|
||||
return sem_ir.types().GetAsInst(type_id).type_id() == TypeType::TypeId;
|
||||
|
||||
Reference in New Issue
Block a user