[clang] [clang][ssaf] Improve docs of SerializationFormatRegistry (PR #181847)
Balázs Benics via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 17 08:07:54 PST 2026
https://github.com/steakhal created https://github.com/llvm/llvm-project/pull/181847
None
>From ae98ade3df13173617fdad0d00efdc95944083a7 Mon Sep 17 00:00:00 2001
From: Balazs Benics <benicsbalazs at gmail.com>
Date: Tue, 17 Feb 2026 17:05:52 +0100
Subject: [PATCH] [clang][ssaf] Improve docs of SerializationFormatRegistry
---
.../SerializationFormatRegistry.h | 21 +++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/clang/include/clang/Analysis/Scalable/Serialization/SerializationFormatRegistry.h b/clang/include/clang/Analysis/Scalable/Serialization/SerializationFormatRegistry.h
index d7e77b9b18f77..ef060dd27c522 100644
--- a/clang/include/clang/Analysis/Scalable/Serialization/SerializationFormatRegistry.h
+++ b/clang/include/clang/Analysis/Scalable/Serialization/SerializationFormatRegistry.h
@@ -7,7 +7,24 @@
//===----------------------------------------------------------------------===//
//
// Registry for SerializationFormats, and some helper functions.
-// To register some custom serialization format, insert this code:
+//
+// To register some custom serialization format, you will need to add some
+// declarations and defintions.
+//
+// Insert this code to the header file:
+//
+// namespace llvm {
+// extern template class CLANG_TEMPLATE_ABI
+// Registry<clang::ssaf::MyFormat::FormatInfo>;
+// } // namespace llvm
+//
+// Insert this declaration to the MyFormat class:
+//
+// using FormatInfo = FormatInfoEntry<SerializerFn, DeserializerFn>;
+//
+// Insert this code to the cpp file:
+//
+// LLVM_INSTANTIATE_REGISTRY(llvm::Registry<MyFormat::FormatInfo>)
//
// static SerializationFormatRegistry::Add<MyFormat>
// RegisterFormat("MyFormat", "My awesome serialization format");
@@ -17,7 +34,7 @@
//
// namespace {
// using FormatInfo = MyFormat::FormatInfo;
-// struct MyAnalysisFormatInfo : FormatInfo {
+// struct MyAnalysisFormatInfo final : FormatInfo {
// MyAnalysisFormatInfo() : FormatInfo{
// SummaryName("MyAnalysis"),
// serializeMyAnalysis,
More information about the cfe-commits
mailing list