A logic issue existed in the Pipe, as it was mistakenly relying on
`IsolatedRoot` instead of the isolated function. That was breaking
things if those functions were to be removed. This issue has been
addressed by correcting the behaviour of the Pipe.
`ReadOnlyContainers` is defined to be a `llvm::StringMap`
of a further `llvm::StringMap` of `std::unique_ptr`s of
`ContainerBase`. A logic issue has been addressed by
properly dereferincing the inner map.
A logic issue existed when validating whether a `cl::opt<T>`
was set. This has been addressed by replacing `isDefaultOption`
method with `getNumOccurrences`, as the former one was not
meant to be used for checking if the option was set or not.
Likewise, the default Option itself is written to a `std::string`,
in method `get`; the latter is leveraged by `Invokable`.
`TupleTreeReference`s use the Root type as a pointer only so they can
operate with forward declarations. Before this commit there were static
asserts that prevented this use case, and thus required the headers
defining the root type to be included before this one to work correctly.
We drop those `static_assert`s to make sure that all headers are parsable
on their own.
This change introduces some duplication but ensures an important
property of `tuple_tree_generate`d: data structures: all the leaves are
scalars. Previously, yield::Function was using efa::BasicBlock, making
things more difficult under certain conditions.
Specifically, we can rely on the fact that, when generating a visit to
the TupleTree, we know everything about all non-scalars.
This commit reduces build times by introducing a type-erasure layer when
performing a visit on TupleTrees. Basically instead of propagating the
type of the visitor along all of the template castle, we wrap the
visitor into a virtual class with one method for each possible type in
the TupleTree.
This enables a single instatiation of visit algorithm.
We used to assign an uninitialized field to `false`. However, what we
really wanted to is to construct the optional by invoking the default
constructor of the `value_type` of the optional.
The index of an element of a `SortedVector<yield::Tag>` was saved, but
`SortedVector` behaves like a set.
The issue has been fixed by creating a temporary `Tag` instead of trying
to keep a reference to an existing one.
This commit introduces a `Kind` for arguments described in
`FunctionType::Layout`. We nowe basically have three types of arguments:
* Scalar: a regular scarlar argument;
* ReferenceToAggregate: a reference to an aggregete argument on the
stack;
* ShadowPointerToAggregateReturnValue: a pointer to the storage for the
(aggregate) return value allocated by the caller;
The architecture-specific pointer (generic register) size is used
instead.
For all the ABIs we support the value of this parameter was already
set to its pointer size. We might need to reintroduce the parameter
in the future if we want to support a super-exotic ABI with different
stack alignment requirements, but that seems highly unlikely.
This also introduces the argument extension helper for one stop all
treating small arguments when they are put into a register or pushed
into the stack.
FunctionMetadata was being deserialized every time they were
inspected. This commit introduces a cache structure to prevent this
excessive deserializations.