Commit Graph
5 Commits
Author SHA1 Message Date
Thomas Köppe f18fc40a32 Add missing standard library header inclusions (#5486)
Discovered by clang-tidy.

See also #5316.
2025-05-28 22:48:20 +00:00
Richard Smith 69b9982e95 Convert discarded calls in thunks. (#5452)
No functionality change right now: we reject thunks where the signature
has no return type and the callee has a return type. But discarding the
expression is still the right thing to do.
2025-05-09 16:35:28 +00:00
Richard SmithandJon Ross-Perkins e060342411 Defer building thunks until the end of the enclosing definition. (#5403)
Instead of building the definition of a thunk immediately when we
generate the thunk declaration, wait until we reach the `}` of the
outermost class, interface, etc. -- at the same time when we would parse
the definition of the thunk if it were defined inline.

This fixes issues where we fail to define the thunk because it requires
an enclosing class to be complete, or its definition depends on
something declared later in the enclosing class.

Make the representation of a suspended function scope, and its
constituent suspended components, be move-only, and switch to passing it
around by rvalue reference instead of by value because it's expensive
both to move and especially to copy.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2025-05-07 22:20:39 +00:00
Richard Smith 8b0f9e503e Add mangling support for thunks. (#5424)
A thunk may have the same mangling as the function that it's a thunk
for, so add `:thunk` to the mangling to disambiguate.
2025-05-05 21:48:51 +00:00
Richard SmithandJon Ross-Perkins 95903dc624 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>
2025-05-01 22:17:55 +00:00