Add protection against pass-visitor misuse: we shall not copy or move passes.
We already didn't. Pass infrastructure already assumed we don't: WithVisitorRef relied on a framework-managed pointer into the pass at its original location. This change only makes the rule explicit and adds fail-fast detection.
Nothing changes in the test suite because the improvement is of a CFA developer's experience. The original (cfa-cpp build, and therefore the resulting) libcfa build and the test suite are happy with the change.
Adjust pass-visitor utilities to help avoid unnecessary CRTP.
Now, an isInFunction query comes straight from a new WithFunctionScope mixin, rather than relying on WithVisitorRef<Self>.
This change admits an upcoming isInFunction use from the concurrency Keywords pass without turning this base pass into a template, i.e. without turning a ton of regular functions into template functions, i.e. without causing g++ to make duplicates across coroutine, thread, etc of much common code. Generally, it lets us avoiding unnecessary template-induced copying, by allowing reused base types to know isInFunction without becoming template<Self>.
All the uses ported to WithFunctionScope here were on concrete types, so they were not templates, so they are not relieved of being unnecessary templates. These were the only use of Pass's former inFunction state. (Box, GenInit, CompoundLiteral, Specialize, Resolver.)
Nothing changes in the test suite because the current change (coming improvement) is of CFA-CPP build-time mechanics. The original libcfa build and test suite are happy with the change.
Route the generated lock/unlock through WithScopedAdds (funcDefn). In Autogen, use Autogen's pre-existing functionNesting state to keep the cfa_linkonce form only at file scope.
Add test_monitor to concurrency/in-function. Fails without either compiler change.
Allow a coroutine to be declared inside a function
WithScopedAdds gains objDefn, objFwd and objFwdCompletion, and removes cfa_linkonce from nested placements. Every ConcurrentSueKeyword addition now goes through it, so its container bases become private.
Coroutine-cancelled exception vtable handling puts the Keywords pass more in the driver's seat because the correct ordering for these generated code items varies between file- and block-scope, as commented.
Test concurrency/in-function gains test_coroutine. Fails without the compiler change.
Allow actors and their messages to be declared inside a function
The Actors and VirtualDtor passes become WithScopedAdds cores, to cover the send operator, receive wrapper, and virtual-dtor setter/delete fwds.
Add test_actor to concurrency/in-function. Fails without the compiler change. The test moves to WFLAGS_OPT_LAX_WAITING_ON_303 with general actor tests (as actor.hfa includs io_uring, which gives known warning).