================
@@ -0,0 +1,70 @@
+//===- SerializationFormatRegistry.h ----------------------------*- C++ 
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Registry for SerializationFormats, and some helper functions.
+// To register some custom serialization format, insert this code:
+//
+//   static SerializationFormatRegistry::Add<MyFormat>
+//     RegisterFormat("MyFormat", "My awesome serialization format");
+//
+// Then implement the formatter for the specific analysis and register the
+// format info for it:
+//
+//   namespace {
+//   struct MyAnalysisFormatInfo : FormatInfo {
+//     MyAnalysisFormatInfo() : FormatInfo{
+//               SummaryName("MyAnalysis"),
+//               serializeMyAnalysis,
+//               deserializeMyAnalysis,
+//           } {}
+//   };
+//   } // namespace
+//
+//   static llvm::Registry<FormatInfo>::Add<MyAnalysisFormatInfo>
+//       RegisterFormatInfo(
+//         "MyAnalysisFormatInfo",
+//         "The MyFormat format info implementation for MyAnalysis"
+//       );
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef CLANG_ANALYSIS_SCALABLE_SERIALIZATION_SERIALIZATION_FORMAT_REGISTRY_H
+#define CLANG_ANALYSIS_SCALABLE_SERIALIZATION_SERIALIZATION_FORMAT_REGISTRY_H
+
+#include "clang/Analysis/Scalable/Serialization/SerializationFormat.h"
+#include "clang/Support/Compiler.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Registry.h"
+
+namespace clang::ssaf {
+
+/// Check if a SerializationFormat was registered with a given name.
+bool isFormatRegistered(llvm::StringRef FormatName);
----------------
Xazax-hun wrote:

nit: do we actually need the `llvm::` qualifier?

https://github.com/llvm/llvm-project/pull/179516
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to