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
+2 -2
View File
@@ -71,7 +71,7 @@ var dyn: Float(dyn_size);
// CHECK:STDOUT: .f = %f
// CHECK:STDOUT: .GetFloat = %GetFloat
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: <function> = import_ref ir2, inst+5, loc_11 [template = imports.%Float]
// CHECK:STDOUT: %import_ref: <function> = import_ref ir1, inst+5, loc_11 [template = imports.%Float]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Float.ref: <function> = name_ref Float, %import_ref [template = imports.%Float]
// CHECK:STDOUT: %.loc6_14: i32 = int_literal 64 [template = constants.%.1]
@@ -121,7 +121,7 @@ var dyn: Float(dyn_size);
// CHECK:STDOUT: .dyn_size = %dyn_size
// CHECK:STDOUT: .dyn = %dyn
// CHECK:STDOUT: }
// CHECK:STDOUT: %import_ref: <function> = import_ref ir2, inst+5, loc_11 [template = imports.%Float]
// CHECK:STDOUT: %import_ref: <function> = import_ref ir1, inst+5, loc_11 [template = imports.%Float]
// CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
// CHECK:STDOUT: %Float.ref.loc10: <function> = name_ref Float, %import_ref [template = imports.%Float]
// CHECK:STDOUT: %.loc10_26: i32 = int_literal 32 [template = constants.%.1]