Change TypeId to be a thin wrapper around ConstantId. (#4140)

This better follows the principle that types are simply constants of
type `type`, and allows more uniform treatment of types as just another
kind of constant from generics handling.

Use a hash table to map from `TypeId` to information about the complete
type. This makes basic operations on types a bit simpler, and operations
that actually need to access the complete class information a bit more
complex.
This commit is contained in:
Richard Smith
2024-07-17 22:46:03 +00:00
committed by GitHub
parent 65d6e3e221
commit dde0bd0ffe
17 changed files with 355 additions and 277 deletions
@@ -15,13 +15,3 @@ fn F(T:! type) {
// CHECK:STDOUT: ; ModuleID = 'type_param.carbon'
// CHECK:STDOUT: source_filename = "type_param.carbon"
// CHECK:STDOUT:
// CHECK:STDOUT: %type = type {}
// CHECK:STDOUT:
// CHECK:STDOUT: define void @F(%type %T) {
// CHECK:STDOUT: entry:
// CHECK:STDOUT: %p.var = alloca ptr, align 8
// CHECK:STDOUT: %.loc13_15 = load ptr, ptr %p.var, align 8
// CHECK:STDOUT: %.loc13_14.2 = load {}, ptr %.loc13_15, align 1
// CHECK:STDOUT: ret void
// CHECK:STDOUT: }