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
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;
37 friend class SerializationFormat;
38 friend class TestFixture;
39
40 // Target triple of the link unit.
41 llvm::Triple TargetTriple;
42
43 // The namespace identifying this link unit.
44 NestedBuildNamespace LUNamespace;
45
46 // Maps entity names to their unique identifiers within this link unit.
47 EntityIdTable IdTable;
48
49 // Maps entity IDs to their linkage properties.
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 LUSummaryEncoding(llvm::Triple TargetTriple, NestedBuildNamespace LUNamespace)
59 : TargetTriple(std::move(TargetTriple)),
60 LUNamespace(std::move(LUNamespace)) {}
61};
62
63} // namespace clang::ssaf
64
65#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