Before this commit DLATypeSystem used a
std::set<std::unique_ptr<LayoutTypeSystemNode> to hold nodes, allowing
heterogenous lookup with bare pointers, fast removal being a set,
and providing address stability without requiring an ordering between
LayoutTypeSystemNodes.
The same requirements is now obtained more cleanly using with a
BumpPtrAllocator for nodes, and a set of naked pointers to them to
enable fast lookup and removal.
They have been substituted with `print` methods, that are more general.
The `dumpToString` is emitted automatically with a template in a revng
header, for those classes that already have the `print` method anyway.
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.
RemoveExceptionalCalls is a simple pass whose goal is to drop all the
calls to functions marked as `Exceptional` and replace them with an
`UnrechableInst`.
This is mainly useful in the decompilation pipeline.
Before this commit we dropped the body altogether. This was bad because
dropping the body of a Function also clears metadata, preventing the
propagation of FunctionTags from revng.
Now all the functions that are not isolated are simply marked optnone
noinline, so that all the optimizations we do for decompilation are only
restricted to isolated functions.