clang 23.0.0git
TUSummaryEncoding.h
Go to the documentation of this file.
1//===- TUSummaryEncoding.h --------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines the TUSummaryEncoding class, which represents a
10// translation unit summary in its serialized, format-specific encoding.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_ANALYSIS_SCALABLE_ENTITYLINKER_TUSUMMARYENCODING_H
15#define LLVM_CLANG_ANALYSIS_SCALABLE_ENTITYLINKER_TUSUMMARYENCODING_H
16
23#include <map>
24#include <memory>
25
26namespace clang::ssaf {
27
28/// Represents a translation unit summary in its serialized encoding.
29///
30/// TUSummaryEncoding holds entity summary data in a format-specific encoding
31/// that can be manipulated by the entity linker without deserializing the
32/// full EntitySummary objects. This enables efficient entity ID patching
33/// during the linking process.
35 friend class EntityLinker;
36 friend class SerializationFormat;
37 friend class TestFixture;
38
39 // The namespace identifying this translation unit.
40 BuildNamespace TUNamespace;
41
42 // Maps entity names to their unique identifiers within this TU.
43 EntityIdTable IdTable;
44
45 // Maps entity IDs to their linkage properties (None, Internal, External).
46 std::map<EntityId, EntityLinkage> LinkageTable;
47
48 // Encoded summary data organized by summary type and entity ID.
49 std::map<SummaryName,
50 std::map<EntityId, std::unique_ptr<EntitySummaryEncoding>>>
51 Data;
52
53public:
54 explicit TUSummaryEncoding(BuildNamespace TUNamespace)
55 : TUNamespace(std::move(TUNamespace)) {}
56};
57
58} // namespace clang::ssaf
59
60#endif // LLVM_CLANG_ANALYSIS_SCALABLE_ENTITYLINKER_TUSUMMARYENCODING_H
Represents a single namespace in the build process.
Manages entity name interning and provides efficient EntityId handles.
Uniquely identifies an analysis summary.
Definition SummaryName.h:22
TUSummaryEncoding(BuildNamespace TUNamespace)