mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 16:01:04 +01:00
Generate thunks for functions in impls (#5390)
Generate a thunk when a function in an `impl` has a different signature than the function in the interface. This follows the design in [#3763](https://docs.carbon-lang.dev/proposals/p3763.html#impl-members-vs-interface-members), although some of the checks described there are not yet implemented. --------- Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
co-authored by
Jon Ross-Perkins
parent
4f5d11a28b
commit
95903dc624
@@ -14,13 +14,12 @@
|
||||
namespace Carbon::Check {
|
||||
|
||||
auto PerformPointerDereference(
|
||||
Context& context, Parse::AnyPointerDeferenceExprId node_id,
|
||||
SemIR::InstId base_id,
|
||||
Context& context, SemIR::LocId loc_id, SemIR::InstId base_id,
|
||||
llvm::function_ref<auto(SemIR::TypeId not_pointer_type_id)->void>
|
||||
diagnose_not_pointer) -> SemIR::InstId {
|
||||
// TODO: Once we have a finalized design for a pointer interface, use
|
||||
//
|
||||
// HandleUnaryOperator(context, node_id, {"Pointer", "Dereference"});
|
||||
// HandleUnaryOperator(context, loc_id, {"Pointer", "Dereference"});
|
||||
//
|
||||
// to convert to a pointer value.
|
||||
base_id = ConvertToValueExpr(context, base_id);
|
||||
@@ -35,7 +34,7 @@ auto PerformPointerDereference(
|
||||
diagnose_not_pointer(type_id);
|
||||
}
|
||||
return AddInst<SemIR::Deref>(
|
||||
context, node_id, {.type_id = result_type_id, .pointer_id = base_id});
|
||||
context, loc_id, {.type_id = result_type_id, .pointer_id = base_id});
|
||||
}
|
||||
|
||||
} // namespace Carbon::Check
|
||||
|
||||
Reference in New Issue
Block a user