Refactory the IR/builder relationship (#2342)

I'm thinking about how to handle multiple files, and I think the current IRFactory is useful as a file-focused thing. So shifting/renaming accordingly. (doing this in its own PR to make the history a little cleaner for git's move detection)
This commit is contained in:
Jon Ross-Perkins
2022-10-25 12:55:26 -07:00
committed by GitHub
parent 5c3f48b0fb
commit d51ca271af
10 changed files with 67 additions and 80 deletions
+6
View File
@@ -8,9 +8,15 @@
#include "llvm/Support/FormatVariadic.h"
#include "toolchain/lexer/tokenized_buffer.h"
#include "toolchain/semantics/semantics_node.h"
#include "toolchain/semantics/semantics_parse_tree_handler.h"
namespace Carbon {
SemanticsIR::SemanticsIR(const TokenizedBuffer& tokens,
const ParseTree& parse_tree) {
SemanticsParseTreeHandler(tokens, parse_tree, *this).Build();
}
auto SemanticsIR::Print(llvm::raw_ostream& out) const -> void {
out << "identifiers = {\n";
for (int32_t i = 0; i < static_cast<int32_t>(identifiers_.size()); ++i) {