mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 13:11:05 +01:00
Remove param_refs and implicit_param_refs (#4479)
This introduces `calling_convention_param_ids`, a single block that consolidates all the information that was being used by consumers of `param_refs` and `implicit_param_refs`, in a form that's easier to produce and typically easier to consume. See also [this Discord discussion](https://discord.com/channels/655572317891461132/655578254970716160/1300545448909738125) regarding the decision to keep the return slot last in the SemIR calling convention, even though it goes first in the LLVM calling convention. --------- Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
co-authored by
Jon Ross-Perkins
parent
17272cf93c
commit
4f816dd03f
@@ -102,20 +102,6 @@ auto Function::GetNameFromPatternId(const File& sem_ir, InstId pattern_id)
|
||||
return sem_ir.entity_names().Get(binding_pattern.entity_name_id).name_id;
|
||||
}
|
||||
|
||||
auto Function::GetParamFromParamRefId(const File& sem_ir, InstId param_ref_id)
|
||||
-> ParamInfo {
|
||||
auto ref = sem_ir.insts().Get(param_ref_id);
|
||||
|
||||
auto bind_name = ref.TryAs<AnyBindName>();
|
||||
if (bind_name) {
|
||||
param_ref_id = bind_name->value_id;
|
||||
ref = sem_ir.insts().Get(param_ref_id);
|
||||
} else {
|
||||
CARBON_FATAL();
|
||||
}
|
||||
return {param_ref_id, ref.As<AnyParam>(), bind_name};
|
||||
}
|
||||
|
||||
auto Function::GetDeclaredReturnType(const File& file,
|
||||
SpecificId specific_id) const -> TypeId {
|
||||
if (!return_slot_id.is_valid()) {
|
||||
|
||||
Reference in New Issue
Block a user