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