clang 23.0.0git
JSONEntitySummaryEncoding.h
Go to the documentation of this file.
1//===- JSONEntitySummaryEncoding.h ----------------------------------------===//
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// Opaque JSON-based entity summary encoding used by JSONFormat. Stores raw
10// EntitySummary JSON blobs and patches embedded entity ID references without
11// requiring knowledge of the analysis schema.
12//
13//===----------------------------------------------------------------------===//
14
15#ifndef CLANG_LIB_ANALYSIS_SCALABLE_SERIALIZATION_JSONFORMAT_JSONENTITYSUMMARYENCODING_H
16#define CLANG_LIB_ANALYSIS_SCALABLE_SERIALIZATION_JSONFORMAT_JSONENTITYSUMMARYENCODING_H
17
20#include "llvm/Support/JSON.h"
21
22#include <map>
23
24namespace clang::ssaf {
25
26class JSONEntitySummaryEncoding final : public EntitySummaryEncoding {
27 friend JSONFormat;
28
29public:
30 llvm::Error
31 patch(const std::map<EntityId, EntityId> &EntityResolutionTable) override;
32
33private:
34 explicit JSONEntitySummaryEncoding(llvm::json::Value Data)
35 : Data(std::move(Data)) {}
36
37 llvm::Error patchEntityIdObject(llvm::json::Object &Obj,
38 const std::map<EntityId, EntityId> &Table,
39 llvm::json::Value *AtVal);
40 llvm::Error patchRegularObject(llvm::json::Object &Obj,
41 const std::map<EntityId, EntityId> &Table);
42 llvm::Error patchObject(llvm::json::Object &Obj,
43 const std::map<EntityId, EntityId> &Table);
44 llvm::Error patchValue(llvm::json::Value &V,
45 const std::map<EntityId, EntityId> &Table);
46
47 llvm::json::Value Data;
48};
49
50} // namespace clang::ssaf
51
52#endif // CLANG_LIB_ANALYSIS_SCALABLE_SERIALIZATION_JSONFORMAT_JSONENTITYSUMMARYENCODING_H
#define V(N, I)
Represents EntitySummary data in its serialized, format-specific encoding.
llvm::Error patch(const std::map< EntityId, EntityId > &EntityResolutionTable) override
Updates EntityId references in the encoded data.