[clang] [SSAF] Add SerializationFormat Interface (PR #177719)
Gábor Horváth via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 26 01:40:43 PST 2026
================
@@ -0,0 +1,65 @@
+//===- SerializationFormat.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
+//
+//===----------------------------------------------------------------------===//
+//
+// Abstract SerializationFormat interface for reading and writing
+// TUSummary and LinkUnitResolution data.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef CLANG_ANALYSIS_SCALABLE_SERIALIZATION_SERIALIZATION_FORMAT_H
+#define CLANG_ANALYSIS_SCALABLE_SERIALIZATION_SERIALIZATION_FORMAT_H
+
+#include "clang/Analysis/Scalable/Model/BuildNamespace.h"
+#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/StringRef.h"
+#include <string>
+#include <vector>
+
+namespace clang {
+namespace ssaf {
+
+class TUSummary;
+class EntityIdTable;
+class EntityName;
+class EntityId;
+class TUSummaryData;
+
+/// Abstract base class for serialization formats.
+class SerializationFormat {
+protected:
+ // Helpers providing access to implementation details of basic data structures
+ // for efficient serialization/deserialization.
+ static EntityIdTable &getIdTableForDeserialization(TUSummary &S);
+ static NestedBuildNamespace &
+ getCommonNamespaceForDeserialization(TUSummary &S);
+ static const EntityIdTable &getIdTable(const TUSummary &S);
+ static const NestedBuildNamespace &getCommonNamespace(const TUSummary &S);
+
+ static BuildNamespaceKind getBuildNamespaceKind(const BuildNamespace &BN);
+ static const std::string &getBuildNamespaceName(const BuildNamespace &BN);
----------------
Xazax-hun wrote:
Should this return a `StringRef` instead?
https://github.com/llvm/llvm-project/pull/177719
More information about the cfe-commits
mailing list