clang 22.0.0git
FormulaSerialization.h
Go to the documentation of this file.
1//=== FormulaSerialization.h - Formula De/Serialization support -*- 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#ifndef LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_FORMULA_SERIALIZATION_H
10#define LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_FORMULA_SERIALIZATION_H
11
14#include "clang/Basic/LLVM.h"
15#include "llvm/ADT/ArrayRef.h"
16#include "llvm/ADT/DenseMap.h"
17#include "llvm/ADT/DenseMapInfo.h"
18#include "llvm/Support/Allocator.h"
19#include "llvm/Support/raw_ostream.h"
20#include <cassert>
21#include <string>
22
23namespace clang::dataflow {
24
25/// Prints `F` to `OS` in a compact format, optimized for easy parsing
26/// (deserialization) rather than human use.
27void serializeFormula(const Formula &F, llvm::raw_ostream &OS);
28
29/// Parses `Str` to build a serialized Formula.
30/// @returns error on parse failure or if parsing does not fully consume `Str`.
31/// @param A used to construct the formula components.
32/// @param AtomMap maps serialized Atom identifiers (unsigned ints) to Atoms.
33/// This map is provided by the caller to enable consistency across
34/// multiple formulas in a single file.
35llvm::Expected<const Formula *>
36parseFormula(llvm::StringRef Str, Arena &A,
37 llvm::DenseMap<unsigned, Atom> &AtomMap);
38
39} // namespace clang::dataflow
40#endif
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
The Arena owns the objects that model data within an analysis.
Definition Arena.h:21
Dataflow Directional Tag Classes.
Definition AdornedCFG.h:29
void serializeFormula(const Formula &F, llvm::raw_ostream &OS)
Prints F to OS in a compact format, optimized for easy parsing (deserialization) rather than human us...
llvm::Expected< const Formula * > parseFormula(llvm::StringRef Str, Arena &A, llvm::DenseMap< unsigned, Atom > &AtomMap)
Parses Str to build a serialized Formula.