LLVM 22.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
14#include "llvm/Support/Error.h"
15#include <stdint.h>
16#include <vector>
17
18namespace llvm {
19class raw_ostream;
20
21namespace gsym {
22
23class GsymReader;
24struct FunctionInfo;
26 std::vector<FunctionInfo> MergedFunctions;
27
28 LLVM_ABI void clear();
29
30 /// Query if a MergedFunctionsInfo object is valid.
31 ///
32 /// \returns A boolean indicating if this FunctionInfo is valid.
33 bool isValid() { return !MergedFunctions.empty(); }
34
35 /// Get a vector of DataExtractor objects for the functions in this
36 /// MergedFunctionsInfo object.
37 ///
38 /// \param Data The binary stream to read the data from. This object must have
39 /// the data for the MergedFunctionsInfo object starting at offset zero. The
40 /// data can contain more data than needed.
41 ///
42 /// \returns An llvm::Expected containing a vector of DataExtractor objects on
43 /// success, or an error object if parsing fails.
46
47 /// Decode an MergedFunctionsInfo object from a binary data stream.
48 ///
49 /// \param Data The binary stream to read the data from. This object must have
50 /// the data for the MergedFunctionsInfo object starting at offset zero. The
51 /// data can contain more data than needed.
52 ///
53 /// \param BaseAddr The base address to use when encoding all address ranges.
54 ///
55 /// \returns An MergedFunctionsInfo or an error describing the issue that was
56 /// encountered during decoding.
59
60 /// Encode this MergedFunctionsInfo object into FileWriter stream.
61 ///
62 /// \param O The binary stream to write the data to at the current file
63 /// position.
64 /// \returns An error object that indicates success or failure for the
65 /// encoding process.
67};
68
71
72} // namespace gsym
73} // namespace llvm
74
75#endif // LLVM_DEBUGINFO_GSYM_MERGEDFUNCTIONSINFO_H
#define LLVM_ABI
Definition Compiler.h:213
Value * RHS
Value * LHS
Lightweight error class with error context and mandatory checking.
Definition Error.h:159
Tagged union holding either a T or a Error.
Definition Error.h:485
A simplified binary data writer class that doesn't require targets, target definitions,...
Definition FileWriter.h:30
GsymReader is used to read GSYM data from a file or buffer.
Definition GsymReader.h:45
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
bool operator==(const FunctionInfo &LHS, const FunctionInfo &RHS)
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr uintptr_t uintptr_t Data
Definition InstrProf.h:189
Function information in GSYM files encodes information for one contiguous address range.
static LLVM_ABI llvm::Expected< MergedFunctionsInfo > decode(DataExtractor &Data, uint64_t BaseAddr)
Decode an MergedFunctionsInfo object from a binary data stream.
static LLVM_ABI 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_ABI llvm::Error encode(FileWriter &O) const
Encode this MergedFunctionsInfo object into FileWriter stream.
std::vector< FunctionInfo > MergedFunctions