Fix compilation error: the expression 'co_await
__promise.final_suspend()' is required to be non-throwing
This compilation error started being triggered when switching to
clang-12.
Requires IsKeyedObjectContainer in TupleTree.h wherever possible,
instead of IsContainer. This enables using std::vectors.
In this way, they will not be diffed based on the key, but on the entire
vector. This is intended.
Add a specialization for
CallByPathVisitorWithInstance::visitContainerElement to handle cases
where the element of the container is an UpcastablePointer, that needs
to be unwrapped before visiting.
This fixes a problem causing bad TupleTree traversal with
TupleTreeReference. Specifically, CallByPathVisitorWithInstance did not
know how to visitContainerElement when the element of the container was
an UpcastablePointer. This caused the visit to always return nullptr
even when the TupleTreeReference was well-formed. This has been fixed by
adding an overload with proper concept constraint, that teaches
CallByPathVisitorWithInstance how to properly traverse
UpcastablePointers.
The second template parameter, defaulted to void, was only used for
SFINAE with enable_if. Now that all uses of enable_if are gone replaced
by concepts, this parameter does not serve any purpose anymore.
* Assert that the coroutine has reached its final suspension point
when the destructor is called.
* Ensure the move assignment operator takes an rvalue reference.
* Explicitly delete the copy assignment operator.
Checking if a `SwitchInst` has a certain case triggers a linear search.
When we have *a lot* of jump targets this is an issue.
This commit assumes that when we add a case to a dispatcher, that case
is not already there.
This commit slightly improves VariableManager's API and, most
importantly, undef-initializes all TCG variables in order to avoid
creation of complex PHIs.
In large binaries PHI nodes show up. As a consequence, calls to `newpc`
are no longer the first instruction.
This commit uses the `getFirstNonPHI` method to fix this issue.
This commit drops the KeyTraits in favor of a std::any-like solution.
Basically, we type erase any key the user wants to employ, just exposing
a virtual version of the destructor, a comparison operator and a clone
primitive.
Before this commit, the execution logic of RecursiveCoroutine used an
underlying std::stack allocated on the heap to hold all the
coroutine_handles. It also manually managed passing return values from
callees to callers.
This commit drops this unnecessary auxiliary stack.
When a RecursiveCoroutine co_awaits another one, the handle of the
awaiter is injected into the awaitee, so that when the awaitee is done
it can directly execute the remaining part of the awaiter as a
continuation.