clang 24.0.0git
LUSummaryEncoding.h
Go to the documentation of this file.
1//===- LUSummaryEncoding.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 LUSummaryEncoding class, which represents a link unit
10// summary in its serialized, format-specific encoding.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_SCALABLESTATICANALYSIS_CORE_ENTITYLINKER_LUSUMMARYENCODING_H
15#define LLVM_CLANG_SCALABLESTATICANALYSIS_CORE_ENTITYLINKER_LUSUMMARYENCODING_H
16
23#include "llvm/TargetParser/Triple.h"
24#include <map>
25#include <memory>
26
27namespace clang::ssaf {
28
29class MultiArchCreateCLI;
30
31/// Represents a link unit summary in its serialized encoding.
32///
33/// LUSummaryEncoding holds the combined entity summary data from multiple
34/// translation units in a format-specific encoding. It is produced by the
35/// entity linker and contains deduplicated and patched entity summaries.
37 friend class EntityLinker;
38 friend class MultiArchCreateCLI;
40 friend class SerializationFormat;
41 friend class TestFixture;
42
43 // Target triple of the link unit.
44 llvm::Triple TargetTriple;
45
46 // The namespace identifying this link unit.
47 NestedBuildNamespace LUNamespace;
48
49 // Maps entity names to their unique identifiers within this link unit.
50 EntityIdTable IdTable;
51
52 // Maps entity IDs to their linkage properties.
53 std::map<EntityId, EntityLinkage> LinkageTable;
54
55 // Encoded summary data organized by summary type and entity ID.
56 std::map<SummaryName,
57 std::map<EntityId, std::unique_ptr<EntitySummaryEncoding>>>
58 Data;
59
60public:
61 LUSummaryEncoding(llvm::Triple TargetTriple, NestedBuildNamespace LUNamespace)
62 : TargetTriple(std::move(TargetTriple)),
63 LUNamespace(std::move(LUNamespace)) {}
64};
65
66} // namespace clang::ssaf
67
68#endif // LLVM_CLANG_SCALABLESTATICANALYSIS_CORE_ENTITYLINKER_LUSUMMARYENCODING_H
Manages entity name interning and provides efficient EntityId handles.
LUSummaryEncoding(llvm::Triple TargetTriple, NestedBuildNamespace LUNamespace)
Represents a hierarchical sequence of build namespaces.
Uniquely identifies an analysis summary.
Definition SummaryName.h:22