LLVM 20.0.0git
LineEntry.h
Go to the documentation of this file.
1//===- LineEntry.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_LINEENTRY_H
10#define LLVM_DEBUGINFO_GSYM_LINEENTRY_H
11
13
14namespace llvm {
15namespace gsym {
16
17/// Line entries are used to encode the line tables in FunctionInfo objects.
18/// They are stored as a sorted vector of these objects and store the
19/// address, file and line of the line table row for a given address. The
20/// size of a line table entry is calculated by looking at the next entry
21/// in the FunctionInfo's vector of entries.
22struct LineEntry {
23 uint64_t Addr; ///< Start address of this line entry.
24 uint32_t File; ///< 1 based index of file in FileTable
25 uint32_t Line; ///< Source line number.
27 : Addr(A), File(F), Line(L) {}
28 bool isValid() { return File != 0; }
29};
30
32 return OS << "addr=" << HEX64(LE.Addr) << ", file=" << format("%3u", LE.File)
33 << ", line=" << format("%3u", LE.Line);
34}
35
36inline bool operator==(const LineEntry &LHS, const LineEntry &RHS) {
37 return LHS.Addr == RHS.Addr && LHS.File == RHS.File && LHS.Line == RHS.Line;
38}
39inline bool operator!=(const LineEntry &LHS, const LineEntry &RHS) {
40 return !(LHS == RHS);
41}
42inline bool operator<(const LineEntry &LHS, const LineEntry &RHS) {
43 return LHS.Addr < RHS.Addr;
44}
45} // namespace gsym
46} // namespace llvm
47#endif // LLVM_DEBUGINFO_GSYM_LINEENTRY_H
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
#define HEX64(v)
Definition: ExtractRanges.h:20
#define F(x, y, z)
Definition: MD5.cpp:55
raw_pwrite_stream & OS
Value * RHS
Value * LHS
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
raw_ostream & operator<<(raw_ostream &OS, const CallSiteInfo &CSI)
bool operator<(const FunctionInfo &LHS, const FunctionInfo &RHS)
This sorting will order things consistently by address range first, but then followed by increasing l...
Definition: FunctionInfo.h:231
bool operator!=(const FunctionInfo &LHS, const FunctionInfo &RHS)
Definition: FunctionInfo.h:214
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
bool operator==(const AddressRangeValuePair &LHS, const AddressRangeValuePair &RHS)
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
Definition: Format.h:125
Line entries are used to encode the line tables in FunctionInfo objects.
Definition: LineEntry.h:22
uint32_t File
1 based index of file in FileTable
Definition: LineEntry.h:24
uint32_t Line
Source line number.
Definition: LineEntry.h:25
LineEntry(uint64_t A=0, uint32_t F=0, uint32_t L=0)
Definition: LineEntry.h:26
uint64_t Addr
Start address of this line entry.
Definition: LineEntry.h:23