Rename SemIR::Node to SemIR::Inst (#3355)

And generally replace "node" by "inst" in the code and "instruction" in
comments.

---------

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
This commit is contained in:
josh11b
2023-11-02 17:58:30 +00:00
committed by GitHub
co-authored by Chandler Carruth
parent 35c2142392
commit 7edfd8e02a
63 changed files with 2136 additions and 2115 deletions
+7 -7
View File
@@ -4,7 +4,7 @@
#include "toolchain/check/context.h"
#include "toolchain/check/convert.h"
#include "toolchain/sem_ir/node.h"
#include "toolchain/sem_ir/inst.h"
namespace Carbon::Check {
@@ -26,8 +26,8 @@ auto HandleIfCondition(Context& context, Parse::Node parse_node) -> bool {
auto else_block_id = context.AddDominatedBlockAndBranch(parse_node);
// Start emitting the `then` block.
context.node_block_stack().Pop();
context.node_block_stack().Push(then_block_id);
context.inst_block_stack().Pop();
context.inst_block_stack().Push(then_block_id);
context.AddCurrentCodeBlockToFunction();
context.node_stack().Push(parse_node, else_block_id);
@@ -38,7 +38,7 @@ auto HandleIfStatementElse(Context& context, Parse::Node parse_node) -> bool {
auto else_block_id = context.node_stack().Pop<Parse::NodeKind::IfCondition>();
// Switch to emitting the `else` block.
context.node_block_stack().Push(else_block_id);
context.inst_block_stack().Push(else_block_id);
context.AddCurrentCodeBlockToFunction();
context.node_stack().Push(parse_node);
@@ -53,9 +53,9 @@ auto HandleIfStatement(Context& context, Parse::Node parse_node) -> bool {
// block.
auto else_block_id =
context.node_stack().Pop<Parse::NodeKind::IfCondition>();
context.AddNode(SemIR::Branch{parse_node, else_block_id});
context.node_block_stack().Pop();
context.node_block_stack().Push(else_block_id);
context.AddInst(SemIR::Branch{parse_node, else_block_id});
context.inst_block_stack().Pop();
context.inst_block_stack().Push(else_block_id);
break;
}