Adjust handling of values in calls and structs (#2824)

Previously, IR for arguments in calls and struct values was separated out. This merges it back in. Additionally, parameters for functions and struct types had their own IR; the block is still there, but there's a TODO to decide what to do with it.

In the LLVM IR, this has the consequence of emitting expressions that are inputs to a call or struct value within the scope of the function, which is pretty much where it should be. Importantly it happens before the call is encountered.

This change also tinkers with the int and real literal lowering. I'm pretty sure both are still wrong, but was having trouble figuring out a "better" way to do it, and this seems like it'll work for now.
This commit is contained in:
Jon Ross-Perkins
2023-05-18 11:42:03 -07:00
committed by GitHub
parent 4a5d925974
commit e73207429f
76 changed files with 304 additions and 518 deletions
@@ -130,6 +130,13 @@ auto SemanticsNodeStack::PopForParseNodeAndNodeId(ParseNodeKind pop_parse_kind)
return {back.parse_node, back.node_id};
}
auto SemanticsNodeStack::PopForNodeBlockId(ParseNodeKind pop_parse_kind)
-> SemanticsNodeBlockId {
auto back = PopEntry(pop_parse_kind);
RequireValidId(back);
return back.node_block_id;
}
auto SemanticsNodeStack::PopForParseNodeAndNameId(ParseNodeKind pop_parse_kind)
-> std::pair<ParseTree::Node, SemanticsStringId> {
auto back = PopEntry(pop_parse_kind);