mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 07:21:04 +01:00
Refactor semantics to provide a more block-y IR (#2349)
As a step towards builtins, provide more blocks. The intent is that any significant scope change will become its own NodeBlock. Builtins should produce the first set of node blocks. Note, SemanticsIR as set up here isn't handling ordering of import processing -- I haven't thought that through much beyond that we probably want some lighter-weight processing of the parse tree to achieve it. But I think the essence of loading builtins first as their own IR block is... probably right?
This commit is contained in:
@@ -27,6 +27,15 @@ static auto PrintArgs(llvm::raw_ostream& out,
|
||||
out << integer_literal;
|
||||
}
|
||||
|
||||
static auto PrintArgs(llvm::raw_ostream& out, SemanticsNodeBlockId node_block) {
|
||||
out << node_block;
|
||||
}
|
||||
|
||||
static auto PrintArgs(llvm::raw_ostream& out,
|
||||
SemanticsNodeIdAndNodeBlockId node_and_node_block) {
|
||||
out << node_and_node_block.node << ", " << node_and_node_block.node_block;
|
||||
}
|
||||
|
||||
void SemanticsNode::Print(llvm::raw_ostream& out) const {
|
||||
out << kind_ << "(";
|
||||
switch (kind_) {
|
||||
|
||||
Reference in New Issue
Block a user