Skip to content

Changes

Started by mlbrooks
Started 6 days 4 hr ago
Queued 3 ms
Took 53 min on built-in
Add baseline test-suite doc
mlbrooks at
Suppress warning about ill-placed attribute-ignore on struct member when to zero_t passed as ttype.

The added test fails under the prior CodeGen.
mlbrooks at
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.
mlbrooks at
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.
mlbrooks at
Add test for the "cs343" macros in Exception.hfa
mlbrooks at
Add baseline test, what works today for doing concurrency nested within a polymorphic function
mlbrooks at
Allow a generator to be declared inside a function

Add mixin ast::WithScopedAdds, through which ConcurrentSueKeyword adds the
struct forward, the main forward and the getter forward and definition.

Add test_generator to concurrency/in-function.  Fails without the compiler change.
mlbrooks at
Allow a monitor to be declared inside a function

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.
mlbrooks at
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.
mlbrooks at
Test a thread declared inside a function

No compiler change is needed: thread support follows orthogonally from supporting coroutine and monitor (concurrent dtor part).

Add test_thread to concurrency/in-function.
mlbrooks at
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).
mlbrooks at