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_SCALABLESTATICANALYSIS_CORE_ENTITYLINKER_TUSUMMARYENCODING_H
15#define LLVM_CLANG_SCALABLESTATICANALYSIS_CORE_ENTITYLINKER_TUSUMMARYENCODING_H
16
23#include "llvm/TargetParser/Triple.h"
24#include <map>
25#include <memory>
26
27namespace clang::ssaf {
28
29/// Represents a translation unit summary in its serialized encoding.
30///
31/// TUSummaryEncoding holds entity summary data in a format-specific encoding
32/// that can be manipulated by the entity linker without deserializing the
33/// full EntitySummary objects. This enables efficient entity ID patching
34/// during the linking process.
36 friend class EntityLinker;
37 friend class SerializationFormat;
38 friend class TestFixture;
39
40 // Target triple of the translation unit.
41 llvm::Triple TargetTriple;
42
43 // The namespace identifying this translation unit.
44 BuildNamespace TUNamespace;
45
46 // Maps entity names to their unique identifiers within this TU.
47 EntityIdTable IdTable;
48
49 // Maps entity IDs to their linkage properties (None, Internal, External).
50 std::map<EntityId, EntityLinkage> LinkageTable;
51
52 // Encoded summary data organized by summary type and entity ID.
53 std::map<SummaryName,
54 std::map<EntityId, std::unique_ptr<EntitySummaryEncoding>>>
55 Data;
56
57public:
58 TUSummaryEncoding(llvm::Triple TargetTriple, BuildNamespace TUNamespace)
59 : TargetTriple(std::move(TargetTriple)),
60 TUNamespace(std::move(TUNamespace)) {}
61
62 const llvm::Triple &getTargetTriple() const { return TargetTriple; }
63};
64
65} // namespace clang::ssaf
66
67#endif // LLVM_CLANG_SCALABLESTATICANALYSIS_CORE_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
const llvm::Triple & getTargetTriple() const
TUSummaryEncoding(llvm::Triple TargetTriple, BuildNamespace TUNamespace)