mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 06:31:03 +01:00
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:
co-authored by
Jon Ross-Perkins
parent
1349cc1e8e
commit
62fe0cd385
@@ -845,19 +845,6 @@ class TypeCompleter {
|
||||
llvm_unreachable("All builtin kinds were handled above");
|
||||
}
|
||||
|
||||
auto BuildAnyImportRefValueRepr(SemIR::TypeId type_id,
|
||||
SemIR::AnyImportRef import_ref) const
|
||||
-> SemIR::ValueRepr {
|
||||
auto import_ir_inst =
|
||||
context_.import_ir_insts().Get(import_ref.import_ir_inst_id);
|
||||
const auto& import_ir =
|
||||
context_.import_irs().Get(import_ir_inst.ir_id).sem_ir;
|
||||
auto import_inst = import_ir->insts().Get(import_ir_inst.inst_id);
|
||||
CARBON_CHECK(!import_inst.Is<SemIR::AnyImportRef>())
|
||||
<< "If ImportRef can point at another, this would be recursive.";
|
||||
return BuildValueRepr(type_id, import_inst);
|
||||
}
|
||||
|
||||
auto BuildStructOrTupleValueRepr(std::size_t num_elements,
|
||||
SemIR::TypeId elementwise_rep,
|
||||
bool same_as_object_rep) const
|
||||
@@ -983,7 +970,9 @@ class TypeCompleter {
|
||||
case SemIR::FieldDecl::Kind:
|
||||
case SemIR::FunctionDecl::Kind:
|
||||
case SemIR::ImplDecl::Kind:
|
||||
case SemIR::ImportRefLoaded::Kind:
|
||||
case SemIR::ImportRefUnloaded::Kind:
|
||||
case SemIR::ImportRefUsed::Kind:
|
||||
case SemIR::InitializeFrom::Kind:
|
||||
case SemIR::InterfaceDecl::Kind:
|
||||
case SemIR::InterfaceWitness::Kind:
|
||||
@@ -1022,11 +1011,6 @@ class TypeCompleter {
|
||||
return MakePointerValueRepr(type_id, SemIR::ValueRepr::ObjectAggregate);
|
||||
}
|
||||
|
||||
case SemIR::ImportRefLoaded::Kind:
|
||||
case SemIR::ImportRefUsed::Kind:
|
||||
return BuildAnyImportRefValueRepr(type_id,
|
||||
inst.As<SemIR::AnyImportRef>());
|
||||
|
||||
case CARBON_KIND(SemIR::StructType struct_type): {
|
||||
return BuildStructTypeValueRepr(type_id, struct_type);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user