[clang] [clang][ssaf] Add JSONFormat support for WPASuite (PR #187403)

Aviral Goel via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 6 13:31:02 PDT 2026


================
@@ -67,10 +75,102 @@ class SerializationFormat {
 
   static EntityId makeEntityId(const size_t Index) { return EntityId(Index); }
 
+  /// Constructs an empty WPASuite. Bypasses the private default constructor
+  /// so that deserialization code can build a WPASuite incrementally.
+  static WPASuite makeWPASuite() { return WPASuite(); }
+
 #define FIELD(CLASS, FIELD_NAME)                                               \
   static const auto &get##FIELD_NAME(const CLASS &X) { return X.FIELD_NAME; }  \
   static auto &get##FIELD_NAME(CLASS &X) { return X.FIELD_NAME; }
 #include "clang/ScalableStaticAnalysisFramework/Core/Model/PrivateFieldNames.def"
+
+  /// Per-format plugin registry for analysis result (de)serializers.
+  ///
+  /// Each concrete format (e.g. JSONFormat) instantiates this template once
+  /// via a public \c using alias. Analysis authors register support with:
+  ///
+  ///   static MyFormat::AnalysisResultRegistry::Add<MyAnalysisResult>
+  ///       Reg(serializeFn, deserializeFn);
+  ///
+  /// The serializer receives \c const MyAnalysisResult & directly — the
----------------
aviralg wrote:

Changed the comments to avoid this problem altogether.

https://github.com/llvm/llvm-project/pull/187403


More information about the cfe-commits mailing list