Remove nearly all uses of StubReferences. (#3249)

The speculative insertion of StubReferences after elements in an
argument list turned out to not be necessary, because we decided we want
to insert per-argument initialization steps after all arguments are
evaluated, rather than interleaving them. The StubReferences we insert
are causing some minor code complexity, so remove them.

We still create StubReferences when performing patch-ups of
already-emitted code, but we no longer ever need to look through them
when determining whether an initializer was a literal or when evaluating
a type expression.
This commit is contained in:
Richard Smith
2023-09-21 00:00:36 +00:00
committed by GitHub
parent 842b471e67
commit f389844893
66 changed files with 398 additions and 675 deletions
+1 -6
View File
@@ -7,10 +7,7 @@
namespace Carbon::Check {
auto HandleStructComma(Context& context, Parse::Node /*parse_node*/) -> bool {
context.ParamOrArgComma(
/*for_args=*/context.parse_tree().node_kind(
context.node_stack().PeekParseNode()) !=
Parse::NodeKind::StructFieldType);
context.ParamOrArgComma();
return true;
}
@@ -57,7 +54,6 @@ auto HandleStructFieldValue(Context& context, Parse::Node parse_node) -> bool {
auto HandleStructLiteral(Context& context, Parse::Node parse_node) -> bool {
auto refs_id = context.ParamOrArgEnd(
/*for_args=*/true,
Parse::NodeKind::StructLiteralOrStructTypeLiteralStart);
context.PopScope();
@@ -89,7 +85,6 @@ auto HandleStructLiteralOrStructTypeLiteralStart(Context& context,
auto HandleStructTypeLiteral(Context& context, Parse::Node parse_node) -> bool {
auto refs_id = context.ParamOrArgEnd(
/*for_args=*/false,
Parse::NodeKind::StructLiteralOrStructTypeLiteralStart);
context.PopScope();