LLVM 20.0.0git
MergedFunctionsInfo.h
Go to the documentation of this file.
1//===- MergedFunctionsInfo.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#ifndef LLVM_DEBUGINFO_GSYM_MERGEDFUNCTIONSINFO_H
10#define LLVM_DEBUGINFO_GSYM_MERGEDFUNCTIONSINFO_H
11
13#include "llvm/Support/Error.h"
14#include <stdint.h>
15#include <vector>
16
17namespace llvm {
18class raw_ostream;
19
20namespace gsym {
21
22class GsymReader;
23struct FunctionInfo;
25 std::vector<FunctionInfo> MergedFunctions;
26
27 void clear();
28
29 /// Query if a MergedFunctionsInfo object is valid.
30 ///
31 /// \returns A boolean indicating if this FunctionInfo is valid.
32 bool isValid() { return !MergedFunctions.empty(); }
33
34 /// Get a vector of DataExtractor objects for the functions in this
35 /// MergedFunctionsInfo object.
36 ///
37 /// \param Data The binary stream to read the data from. This object must have
38 /// the data for the MergedFunctionsInfo object starting at offset zero. The
39 /// data can contain more data than needed.
40 ///
41 /// \returns An llvm::Expected containing a vector of DataExtractor objects on
42 /// success, or an error object if parsing fails.
45
46 /// Decode an MergedFunctionsInfo object from a binary data stream.
47 ///
48 /// \param Data The binary stream to read the data from. This object must have
49 /// the data for the MergedFunctionsInfo object starting at offset zero. The
50 /// data can contain more data than needed.
51 ///
52 /// \param BaseAddr The base address to use when encoding all address ranges.
53 ///
54 /// \returns An MergedFunctionsInfo or an error describing the issue that was
55 /// encountered during decoding.
57 uint64_t BaseAddr);
58
59 /// Encode this MergedFunctionsInfo object into FileWriter stream.
60 ///
61 /// \param O The binary stream to write the data to at the current file
62 /// position.
63 /// \returns An error object that indicates success or failure for the
64 /// encoding process.
66};
67
69
70} // namespace gsym
71} // namespace llvm
72
73#endif // LLVM_DEBUGINFO_GSYM_MERGEDFUNCTIONSINFO_H
Value * RHS
Value * LHS
Lightweight error class with error context and mandatory checking.
Definition: Error.h:160
Tagged union holding either a T or a Error.
Definition: Error.h:481
A simplified binary data writer class that doesn't require targets, target definitions,...
Definition: FileWriter.h:29
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
bool operator==(const AddressRangeValuePair &LHS, const AddressRangeValuePair &RHS)
static llvm::Expected< MergedFunctionsInfo > decode(DataExtractor &Data, uint64_t BaseAddr)
Decode an MergedFunctionsInfo object from a binary data stream.
static llvm::Expected< std::vector< DataExtractor > > getFuncsDataExtractors(DataExtractor &Data)
Get a vector of DataExtractor objects for the functions in this MergedFunctionsInfo object.
bool isValid()
Query if a MergedFunctionsInfo object is valid.
llvm::Error encode(FileWriter &O) const
Encode this MergedFunctionsInfo object into FileWriter stream.
std::vector< FunctionInfo > MergedFunctions