Multi dimensional arrays are not flattened into 1-D arrays when using
TypeGraph. Update TreeBuilder to account for this.
By not flattening arrays, we are able to produce more descriptive
results.
The disadvantage is that we must now recurse inside arrays
containing only primitives. A better solution to requiring flattening
would be the planned work to not recurse into any static types (not just
primitives). This would also apply to multi-dimensional arrays of
primtivies.
When we were previously removing allocators, we were only able to work
with containers whose allocators appeared as their last template
parameter.
Now we can replace allocators in the middle of a parameter list.
This fixes tests for folly::sorted_vector_set.
This is necessary when replacing the allocator of a map type, for
example.
`std::map<int, int>` will need an allocator which allocates elements of
type `std::pair<const int, int>>`
std::basic_string takes three template parameters:
1. CharT
2. Traits
3. Allocator
The Traits parameter was causing issues, as it requires a type which
exposes certain things, e.g. `Traits::value_type`.
We have a few options to resolve this:
1. Remove this parameter, as we do for allocators
Cons: removing a template parameter doesn't work if other
parameters appear after it
2. Stub this parameter, as we do for hashers/comparators
Cons: we need to hardcode an implementation that satisfies the
`Traits::value_type` requirements
3. Leave the parameter as-is
Cons: will not work if a non-standard Traits is used
By using the real implementation of this Traits parameter
(normally `std::char_traits<CharT>`), we get one that we know will
work as long as it is defined in a stdlib header.
Option 3 is what we use in this patch. Instead of adding more
configuration options to the container TOML file format (e.g.
`params_to_keep = [1]`), we add `std::char_traits` as a dummy
container type. Now, whenever `std::char_traits` appears, it will be
left as-is, i.e. not removed, replaced or reverse-engineered.
This is the same approach previously used for Thrift's isset_bitset.
This change is fully backwards compatible with the old ContainerInfo
parser, as it is just adding new fields.
The old fields will continue to be used by legacy OICodeGen until that
is removed.
Also add a README to document the format.
The "src" directory got renamed to "oi" and the previous rule stopped
matching our source code. By changing to collect coverage for everything
except for "build" and "extern", we should avoid this problem in the
future.
It was previously easy to miss modules and I haven't been able to notice
any difference in behaviour when setting the VLOG level globally
(despite what the old comment says).
Don't enable for local dev builds or for GCC CI builds, as every
compiler version has a different set of warnings and trying to make them
all pass is a neverending task.
With the previous method of enabling them on a target-by-target basis,
it was very easy to accidentally miss a target. This had happened in a
number of instances, e.g. "codegen" and "symbol_service".
Previously we had an `R"(` string in `OITraceCode.cpp` which allowed us
to include the file as a string. Instead, keep `OITraceCode.cpp` a fully
formed C++ file and utilise the build system to turn it into a string.
This will be used for more header files that are needed both as valid
headers and as strings for JIT compilation in the Typed TreeBuilder
work.
CodeCov's docs say that a token isn't required for a public repository,
but our uploads have been broken for a few weeks at this point and
passing in the token fixes them...
This fixes linker errors in debug builds.
When building in debug mode (-DCMAKE_BUILD_TYPE=Debug), folly requires
the function "safe_assert_terminate" to be defined. To avoid building
and linking against folly, we define our own no-op version of this
function.