clang
23.0.0git
include
clang
ScalableStaticAnalysisFramework
Analyses
PointerFlow
PointerFlowFormat.h
Go to the documentation of this file.
1
//===- PointerFlowFormat.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
// JSON serialization helpers for EdgeSet (PointerFlow edge maps).
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_ANALYSES_POINTERFLOW_POINTERFLOWFORMAT_H
14
#define LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_ANALYSES_POINTERFLOW_POINTERFLOWFORMAT_H
15
16
#include "
clang/ScalableStaticAnalysisFramework/Analyses/PointerFlow/PointerFlow.h
"
17
#include "
clang/ScalableStaticAnalysisFramework/Core/Serialization/JSONFormat.h
"
18
#include "llvm/ADT/iterator_range.h"
19
20
namespace
clang::ssaf
{
21
22
/// Serialize an EdgeSet
23
/// {(src1, dest1), (src1, dest2), (src2, dest3), (src2, dest4), ...}
24
/// to an array of arrays of EntityPointerLevels:
25
/// [ [src1, dest1, dest2, ...], [src2, dest3, dest4, ...], ... ]
26
llvm::json::Array
27
edgeSetToJSON
(llvm::iterator_range<EdgeSet::const_iterator> Edges,
28
JSONFormat::EntityIdToJSONFn
IdToJSON);
29
30
/// Deserialize an EdgeSet from the array format produced by `edgeSetToJSON`.
31
llvm::Expected<EdgeSet>
32
edgeSetFromJSON
(
const
llvm::json::Array &EdgesData,
33
JSONFormat::EntityIdFromJSONFn
IdFromJSON);
34
35
}
// namespace clang::ssaf
36
37
#endif
// LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_ANALYSES_POINTERFLOW_POINTERFLOWFORMAT_H
JSONFormat.h
PointerFlow.h
clang::ssaf::JSONFormat::EntityIdFromJSONFn
llvm::function_ref< llvm::Expected< EntityId >(const Object &)> EntityIdFromJSONFn
Definition
JSONFormat.h:71
clang::ssaf::JSONFormat::EntityIdToJSONFn
llvm::function_ref< Object(EntityId)> EntityIdToJSONFn
Definition
JSONFormat.h:70
clang::ssaf
Definition
CallGraphSummary.h:17
clang::ssaf::edgeSetToJSON
llvm::json::Array edgeSetToJSON(llvm::iterator_range< EdgeSet::const_iterator > Edges, JSONFormat::EntityIdToJSONFn IdToJSON)
Serialize an EdgeSet {(src1, dest1), (src1, dest2), (src2, dest3), (src2, dest4), ....
Definition
PointerFlowFormat.cpp:40
clang::ssaf::edgeSetFromJSON
llvm::Expected< EdgeSet > edgeSetFromJSON(const llvm::json::Array &EdgesData, JSONFormat::EntityIdFromJSONFn IdFromJSON)
Deserialize an EdgeSet from the array format produced by edgeSetToJSON.
Definition
PointerFlowFormat.cpp:56
Generated on
for clang by
1.14.0