This change removes support for `VFS` in `SerializationFormat`,
introduced in https://github.com/llvm/llvm-project/pull/179516/. `VFS`
only provides a virtual input backend and its matched pair,
`VirtualOutputBackend`, does not provide support for an
`InMemoryOutputBackend`. There was an attempt from our end to implement
this support in https://github.com/llvm/llvm-project/pull/179515 but it
did not succeed. Supporting virtual reads but not virtual writes makes
the SerializationFormat APIs asymmetric. So we have decided to remove
`VFS` support altogether.
---------
Co-authored-by: Balazs Benics <benicsbalazs@gmail.com>
Add `FormatInfoEntry` template to support per-analysis-type
serialization within a `SerializationFormat`.
This allows to implement different formats for the different analyses in
a decoupled way.
For testing, this patch also implements the MockSerializationFormat
demonstrating the FormatInfo sub-registry pattern.
Assisted-by: claude
Depends on #179516
rdar://169192127
Add a registry infrastructure for SerializationFormat implementations,
enabling registration and instantiation of different serialization
formats.
For example:
```c++
static SerializationFormatRegistry::Add<MyFormat>
RegisterFormat("MyFormat", "Description");
```
Formats can then be instantiated by name using `makeFormat()`.
The patch also updates the SerializationFormat base class to accept
FileSystem for virtualising reading inputs eg. by using file overlays in
the future.
Assisted-by: claude
rdar://169192127
To support multiple serialization formats in SSAF this PR adds a common
serialization format interface. We will separately implement a
serialization format registry similar to
[this](https://github.com/llvm/llvm-project/pull/173290) PR, followed by
a JSON-based serialization format.