mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 09:34:42 +01:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user