mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 15:01:03 +01:00
Store the CppOverloadSetId on CalleeFunction. (#6067)
This commit is contained in:
@@ -16,12 +16,12 @@ namespace Carbon::SemIR {
|
||||
auto GetCalleeFunction(const File& sem_ir, InstId callee_id,
|
||||
SpecificId specific_id) -> CalleeFunction {
|
||||
CalleeFunction result = {.function_id = FunctionId::None,
|
||||
.cpp_overload_set_id = CppOverloadSetId::None,
|
||||
.enclosing_specific_id = SpecificId::None,
|
||||
.resolved_specific_id = SpecificId::None,
|
||||
.self_type_id = InstId::None,
|
||||
.self_id = InstId::None,
|
||||
.is_error = false,
|
||||
.is_cpp_overload_set = false};
|
||||
.is_error = false};
|
||||
if (auto bound_method = sem_ir.insts().TryGetAs<BoundMethod>(callee_id)) {
|
||||
result.self_id = bound_method->object_id;
|
||||
callee_id = bound_method->function_decl_id;
|
||||
@@ -48,9 +48,8 @@ auto GetCalleeFunction(const File& sem_ir, InstId callee_id,
|
||||
auto fn_type_inst =
|
||||
sem_ir.types().GetAsInst(sem_ir.insts().Get(val_id).type_id());
|
||||
|
||||
if (fn_type_inst.TryAs<CppOverloadSetType>()) {
|
||||
// TODO: Consider evaluating this at runtime instead of having a field.
|
||||
result.is_cpp_overload_set = true;
|
||||
if (auto cpp_overload_set_type = fn_type_inst.TryAs<CppOverloadSetType>()) {
|
||||
result.cpp_overload_set_id = cpp_overload_set_type->overload_set_id;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user