mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user