Remove the builtin IR, and instead define builtin types locally. (#3910)

We don't need it any more, and removing it simplifies a few things:

- One fewer predefined `File` and reserved ID.
- We now have simply `Builtin` instructions for builtins, instead of
having an `ImportRef` that indirectly references a `Builtin`.
- `ConstantId`s now always refer directly to a local constant, instead
of sometimes referring to an `ImportRef` for a constant in the builtins
IR.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
Richard Smith
2024-04-24 18:32:59 +00:00
committed by GitHub
co-authored by Jon Ross-Perkins
parent 1349cc1e8e
commit 62fe0cd385
79 changed files with 600 additions and 671 deletions
+1 -2
View File
@@ -787,7 +787,6 @@ auto Driver::Compile(const CompileOptions& options) -> RunResult {
// Check.
SharedValueStores builtin_value_stores;
auto builtins = Check::MakeBuiltins(builtin_value_stores);
llvm::SmallVector<Check::Unit> check_units;
for (auto& unit : units) {
if (unit->has_source()) {
@@ -795,7 +794,7 @@ auto Driver::Compile(const CompileOptions& options) -> RunResult {
}
}
CARBON_VLOG() << "*** Check::CheckParseTrees ***\n";
Check::CheckParseTrees(builtins, llvm::MutableArrayRef(check_units),
Check::CheckParseTrees(llvm::MutableArrayRef(check_units),
options.prelude_import, vlog_stream_);
CARBON_VLOG() << "*** Check::CheckParseTrees done ***\n";
for (auto& unit : units) {