Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:42

0001 //===- LineEntry.h ----------------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_DEBUGINFO_GSYM_LINEENTRY_H
0010 #define LLVM_DEBUGINFO_GSYM_LINEENTRY_H
0011 
0012 #include "llvm/DebugInfo/GSYM/ExtractRanges.h"
0013 
0014 namespace llvm {
0015 namespace gsym {
0016 
0017 /// Line entries are used to encode the line tables in FunctionInfo objects.
0018 /// They are stored as a sorted vector of these objects and store the
0019 /// address, file and line of the line table row for a given address. The
0020 /// size of a line table entry is calculated by looking at the next entry
0021 /// in the FunctionInfo's vector of entries.
0022 struct LineEntry {
0023   uint64_t Addr; ///< Start address of this line entry.
0024   uint32_t File; ///< 1 based index of file in FileTable
0025   uint32_t Line; ///< Source line number.
0026   LineEntry(uint64_t A = 0, uint32_t F = 0, uint32_t L = 0)
0027       : Addr(A), File(F), Line(L) {}
0028   bool isValid() { return File != 0; }
0029 };
0030 
0031 inline raw_ostream &operator<<(raw_ostream &OS, const LineEntry &LE) {
0032   return OS << "addr=" << HEX64(LE.Addr) << ", file=" << format("%3u", LE.File)
0033       << ", line=" << format("%3u", LE.Line);
0034 }
0035 
0036 inline bool operator==(const LineEntry &LHS, const LineEntry &RHS) {
0037   return LHS.Addr == RHS.Addr && LHS.File == RHS.File && LHS.Line == RHS.Line;
0038 }
0039 inline bool operator!=(const LineEntry &LHS, const LineEntry &RHS) {
0040   return !(LHS == RHS);
0041 }
0042 inline bool operator<(const LineEntry &LHS, const LineEntry &RHS) {
0043   return LHS.Addr < RHS.Addr;
0044 }
0045 } // namespace gsym
0046 } // namespace llvm
0047 #endif // LLVM_DEBUGINFO_GSYM_LINEENTRY_H