mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 12:11:04 +01:00
Clean up singleton TypeId use (#6300)
#6289 absentmindedly added fields in more places, and this is undoing that plus further fixes. This does some cleanup of types with relation to singletons. For `TypeType` and `ErrorInst`, they're always complete due to a `SetComplete` call in `file.cpp`. For `CppVoidType`, it's intended to be incomplete by construction, and so a `TypeId` should be okay. The intent though on not generally providing these had been that `GetSingletonType` needs to be called to get a type to be marked as complete. In the case of `AutoType`, removing `TypeId`does change a small printing detail. I think that's old legacy that's just been carried forward. Otherwise, for both `InstType` and `AutoType`, I've added `GetSingletonType` calls where they were used in order to ensure completeness is applied correctly. These calls cause small SemIR permutations. This causes `AutoType` to be seen by lowering, so I'm adding a placeholder for it. Also merging two functions that look like they're identical in intent -- not sure why they're separate. --------- Co-authored-by: Dana Jansens <danakj@orodu.net>
This commit is contained in:
co-authored by
Dana Jansens
parent
f272198ce5
commit
42e2280150
@@ -1054,9 +1054,9 @@ fn F() {
|
||||
// CHECK:STDOUT: --- import_decl_pointer_param_type.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %C [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
@@ -1090,9 +1090,9 @@ fn F() {
|
||||
// CHECK:STDOUT: --- import_definition_pointer_param_type.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %C [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
|
||||
Reference in New Issue
Block a user