Move definition of member of Function to function.cpp where it belongs. (#4170)

This commit is contained in:
Richard Smith
2024-07-25 21:22:07 +00:00
committed by GitHub
parent fbb1cd36c0
commit 2ef1d1f8b9
2 changed files with 17 additions and 17 deletions
+17
View File
@@ -42,6 +42,23 @@ auto GetCalleeFunction(const File& sem_ir, InstId callee_id) -> CalleeFunction {
return result;
}
auto Function::GetParamFromParamRefId(const File& sem_ir, InstId param_ref_id)
-> std::pair<InstId, Param> {
auto ref = sem_ir.insts().Get(param_ref_id);
if (auto addr_pattern = ref.TryAs<SemIR::AddrPattern>()) {
param_ref_id = addr_pattern->inner_id;
ref = sem_ir.insts().Get(param_ref_id);
}
if (auto bind_name = ref.TryAs<SemIR::AnyBindName>()) {
param_ref_id = bind_name->value_id;
ref = sem_ir.insts().Get(param_ref_id);
}
return {param_ref_id, ref.As<SemIR::Param>()};
}
auto Function::GetDeclaredReturnType(const File& file,
SpecificId specific_id) const -> TypeId {
if (!return_storage_id.is_valid()) {