mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 06:11:05 +01:00
Expand use of IndexBase (#2436)
Initially I'd added this to lexer, this includes parser and semantics. Also adds ComparableIndexBase to unify a few common cases where <> comparisons are supported. Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
co-authored by
Richard Smith
parent
94cf343b05
commit
d50fef1736
@@ -26,7 +26,7 @@ auto SemanticsIR::MakeBuiltinIR() -> SemanticsIR {
|
||||
SemanticsNodeId(TypeOfTypeType)));
|
||||
semantics.cross_references_[SemanticsBuiltinKind::TypeType().AsInt()] =
|
||||
SemanticsCrossReference(BuiltinIR, block_id, type_type);
|
||||
CARBON_CHECK(type_type.id == TypeOfTypeType)
|
||||
CARBON_CHECK(type_type.index == TypeOfTypeType)
|
||||
<< "TypeType's type must be self-referential.";
|
||||
|
||||
constexpr int32_t TypeOfInvalidType = 1;
|
||||
@@ -35,7 +35,7 @@ auto SemanticsIR::MakeBuiltinIR() -> SemanticsIR {
|
||||
SemanticsNodeId(TypeOfInvalidType)));
|
||||
semantics.cross_references_[SemanticsBuiltinKind::InvalidType().AsInt()] =
|
||||
SemanticsCrossReference(BuiltinIR, block_id, invalid_type);
|
||||
CARBON_CHECK(invalid_type.id == TypeOfInvalidType)
|
||||
CARBON_CHECK(invalid_type.index == TypeOfInvalidType)
|
||||
<< "InvalidType's type must be self-referential.";
|
||||
|
||||
auto integer_literal_type = semantics.AddNode(
|
||||
|
||||
Reference in New Issue
Block a user