Refactor ReturnTypeInfo and InitRepr. (#4169)

Rename `ReturnInfo` to `ReturnTypeInfo`. Move it and `InitRepr` into
`type_info.h` alongside `ValueRepr`. Replace `ReturnSlot` with
`InitRepr`, and extend `InitRepr` to be able to represent the
incomplete-type case instead of CHECK-failing. Remove `has_return_slot`
from `InitRepr` and instead only provide that as part of
`ReturnTypeInfo`.
This commit is contained in:
Richard Smith
2024-07-25 21:41:33 +00:00
committed by GitHub
parent 2ef1d1f8b9
commit 37a8bfa488
19 changed files with 194 additions and 194 deletions
+2 -2
View File
@@ -306,7 +306,7 @@ class FormatterImpl {
if (fn.return_storage_id.is_valid()) {
out_ << " -> ";
auto return_info = fn.GetReturnInfo(sem_ir_);
auto return_info = ReturnTypeInfo::ForFunction(sem_ir_, fn);
if (!fn.body_block_ids.empty() && return_info.is_valid() &&
return_info.has_return_slot()) {
FormatName(fn.return_storage_id);
@@ -712,7 +712,7 @@ class FormatterImpl {
llvm::ArrayRef<InstId> args = sem_ir_.inst_blocks().Get(inst.args_id);
auto return_info = ReturnInfo::ForType(sem_ir_, inst.type_id);
auto return_info = ReturnTypeInfo::ForType(sem_ir_, inst.type_id);
bool has_return_slot = return_info.has_return_slot();
InstId return_slot_id = InstId::Invalid;
if (has_return_slot) {