mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Put the IR for the return type in the same block as the IR for the parameters. (#3145)
Previously, IR generated for the computation of the return type ended up in the package's node block. Put it with the IR for the parameters for consistency and cleanliness.
This commit is contained in:
@@ -19,14 +19,6 @@ auto HandleDeducedParameterListStart(Context& context,
|
||||
auto HandleParameterList(Context& context, ParseTree::Node parse_node) -> bool {
|
||||
auto refs_id = context.ParamOrArgEnd(
|
||||
/*for_args=*/false, ParseNodeKind::ParameterListStart);
|
||||
// TODO: This contains the IR block for parameters. At present, it's just
|
||||
// loose, but it's not strictly required for parameter refs; we should either
|
||||
// stop constructing it completely or, if it turns out to be needed, store it.
|
||||
// Note, the underlying issue is that the LLVM IR has nowhere clear to emit,
|
||||
// so changing storage would require addressing that problem. For comparison
|
||||
// with function calls, the IR needs to be emitted prior to the call.
|
||||
context.node_block_stack().Pop();
|
||||
|
||||
context.PopScope();
|
||||
context.node_stack()
|
||||
.PopAndDiscardSoloParseNode<ParseNodeKind::ParameterListStart>();
|
||||
@@ -44,7 +36,6 @@ auto HandleParameterListStart(Context& context, ParseTree::Node parse_node)
|
||||
-> bool {
|
||||
context.PushScope();
|
||||
context.node_stack().Push(parse_node);
|
||||
context.node_block_stack().Push();
|
||||
context.ParamOrArgStart();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user