clang 23.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
29/// Represents a link unit summary in its serialized encoding.
30///
31/// LUSummaryEncoding holds the combined entity summary data from multiple
32/// translation units in a format-specific encoding. It is produced by the
33/// entity linker and contains deduplicated and patched entity summaries.
35 friend class EntityLinker;
36 friend class SerializationFormat;
37 friend class TestFixture;
38
39 // Target triple of the link unit.
40 llvm::Triple TargetTriple;
41
42 // The namespace identifying this link unit.
43 NestedBuildNamespace LUNamespace;
44
45 // Maps entity names to their unique identifiers within this link unit.
46 EntityIdTable IdTable;
47
48 // Maps entity IDs to their linkage properties.
49 std::map<EntityId, EntityLinkage> LinkageTable;
50
51 // Encoded summary data organized by summary type and entity ID.
52 std::map<SummaryName,
53 std::map<EntityId, std::unique_ptr<EntitySummaryEncoding>>>
54 Data;
55
56public:
57 LUSummaryEncoding(llvm::Triple TargetTriple, NestedBuildNamespace LUNamespace)
58 : TargetTriple(std::move(TargetTriple)),
59 LUNamespace(std::move(LUNamespace)) {}
60};
61
62} // namespace clang::ssaf
63
64#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