Start adding var decls to semantics. (#2447)

This is just the declaration, without initialization. Partly breaking it out because I'm changing the placeholder builtin types.

Might also need to separate out storage of the var from the name bind.
This commit is contained in:
Jon Ross-Perkins authored and GitHub committed 2022-12-07 15:10:42 -08:00
1 parent 04f0288cd2
commit 30960d11a9
7 files changed
+130 -17

No files matched your search

+6 -7
View File
@@ -39,16 +39,15 @@ auto SemanticsIR::MakeBuiltinIR() -> SemanticsIR {
<< "InvalidType's type must be self-referential.";
auto integer_literal_type = semantics.AddNode(
block_id, SemanticsNode::MakeBuiltin(
SemanticsBuiltinKind::IntegerLiteralType(), type_type));
semantics
.cross_references_[SemanticsBuiltinKind::IntegerLiteralType().AsInt()] =
block_id, SemanticsNode::MakeBuiltin(SemanticsBuiltinKind::IntegerType(),
type_type));
semantics.cross_references_[SemanticsBuiltinKind::IntegerType().AsInt()] =
SemanticsCrossReference(BuiltinIR, block_id, integer_literal_type);
auto real_literal_type = semantics.AddNode(
block_id, SemanticsNode::MakeBuiltin(
SemanticsBuiltinKind::RealLiteralType(), type_type));
semantics.cross_references_[SemanticsBuiltinKind::RealLiteralType().AsInt()] =
block_id,
SemanticsNode::MakeBuiltin(SemanticsBuiltinKind::RealType(), type_type));
semantics.cross_references_[SemanticsBuiltinKind::RealType().AsInt()] =
SemanticsCrossReference(BuiltinIR, block_id, real_literal_type);
CARBON_CHECK(semantics.node_blocks_.size() == 1)