LLVM 24.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 {
19
20namespace gsym {
21
22struct FunctionInfo;
24 std::vector<FunctionInfo> MergedFunctions;
25
26 LLVM_ABI void clear();
27
28 /// Query if a MergedFunctionsInfo object is valid.
29 ///
30 /// \returns A boolean indicating if this FunctionInfo is valid.
31 bool isValid() { return !MergedFunctions.empty(); }
32
33 /// Get a vector of GsymDataExtractor objects for the functions in this
34 /// MergedFunctionsInfo object.
35 ///
36 /// \param Data The binary stream to read the data from. This object must have
37 /// the data for the MergedFunctionsInfo object starting at offset zero. The
38 /// data can contain more data than needed.
39 ///
40 /// \returns An llvm::Expected containing a vector of GsymDataExtractor
41 /// objects on success, or an error object if parsing fails.
44
45 /// Decode an MergedFunctionsInfo object from a binary data stream.
46 ///
47 /// \param Data The binary stream to read the data from. This object must have
48 /// the data for the MergedFunctionsInfo object starting at offset zero. The
49 /// data can contain more data than needed.
50 ///
51 /// \param BaseAddr The base address to use when encoding all address ranges.
52 ///
53 /// \returns An MergedFunctionsInfo or an error describing the issue that was
54 /// encountered during decoding.
57
58 /// Encode this MergedFunctionsInfo object into FileWriter stream.
59 ///
60 /// \param O The binary stream to write the data to at the current file
61 /// position.
62 /// \returns An error object that indicates success or failure for the
63 /// encoding process.
65};
66
69
70} // namespace gsym
71} // namespace llvm
72
73#endif // LLVM_DEBUGINFO_GSYM_MERGEDFUNCTIONSINFO_H
uint64_t uint64_t
#define LLVM_ABI
Definition Compiler.h:211
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
A DataExtractor subclass that adds GSYM-specific string offset support.
bool operator==(const FunctionInfo &LHS, const FunctionInfo &RHS)
This is an optimization pass for GlobalISel generic memory operations.
Function information in GSYM files encodes information for one contiguous address range.
static LLVM_ABI llvm::Expected< std::vector< GsymDataExtractor > > getFuncsDataExtractors(GsymDataExtractor &Data)
Get a vector of GsymDataExtractor 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
static LLVM_ABI llvm::Expected< MergedFunctionsInfo > decode(GsymDataExtractor &Data, uint64_t BaseAddr)
Decode an MergedFunctionsInfo object from a binary data stream.