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