[clang] [clang][ssaf] Improve docs of SerializationFormatRegistry (PR #181847)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 17 08:08:31 PST 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang-ssaf
Author: Balázs Benics (steakhal)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/181847.diff
1 Files Affected:
- (modified) clang/include/clang/Analysis/Scalable/Serialization/SerializationFormatRegistry.h (+19-2)
``````````diff
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,
``````````
</details>
https://github.com/llvm/llvm-project/pull/181847
More information about the cfe-commits
mailing list