clang 23.0.0git
EntitySummaryEncoding.h
Go to the documentation of this file.
1//===- EntitySummaryEncoding.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 EntitySummaryEncoding class, which represents
10// EntitySummary data in an encoded, format-specific form.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_CORE_ENTITYLINKER_ENTITYSUMMARYENCODING_H
15#define LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_CORE_ENTITYLINKER_ENTITYSUMMARYENCODING_H
16
18#include "llvm/Support/Error.h"
19#include <map>
20
21namespace clang::ssaf {
22
23/// Represents EntitySummary data in its serialized, format-specific encoding.
24///
25/// This abstract base class allows the entity linker to manipulate serialized
26/// entity summary data without knowing the exact schema of the EntitySummary
27/// subclass. The primary operation is patching EntityId references when
28/// entities are merged during linking.
30public:
31 virtual ~EntitySummaryEncoding() = default;
32
33 /// Updates EntityId references in the encoded data.
34 ///
35 /// \param EntityResolutionTable Mapping from old EntityIds to new EntityIds.
36 virtual llvm::Error
37 patch(const std::map<EntityId, EntityId> &EntityResolutionTable) = 0;
38};
39
40} // namespace clang::ssaf
41
42#endif // LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_CORE_ENTITYLINKER_ENTITYSUMMARYENCODING_H
Represents EntitySummary data in its serialized, format-specific encoding.
virtual ~EntitySummaryEncoding()=default
virtual llvm::Error patch(const std::map< EntityId, EntityId > &EntityResolutionTable)=0
Updates EntityId references in the encoded data.