LLDB  mainline
DIERef.h
Go to the documentation of this file.
1 //===-- DIERef.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 SymbolFileDWARF_DIERef_h_
10 #define SymbolFileDWARF_DIERef_h_
11 
12 #include "lldb/Core/dwarf.h"
13 #include "lldb/lldb-defines.h"
14 
15 class DWARFFormValue;
16 class SymbolFileDWARF;
17 
18 struct DIERef {
19  DIERef() = default;
20 
22 
23  // In order to properly decode a lldb::user_id_t back into a DIERef we
24  // need the DWARF file since it knows if DWARF in .o files is being used
25  // (MacOSX) or if DWO files are being used. The encoding of the user ID
26  // differs between the two types of DWARF.
27  explicit DIERef(lldb::user_id_t uid, SymbolFileDWARF *dwarf);
28 
29  explicit DIERef(const DWARFFormValue &form_value);
30 
31  // In order to properly encode a DIERef unto a lldb::user_id_t we need
32  // the DWARF file since it knows if DWARF in .o files is being used
33  // (MacOSX) or if DWO files are being used. The encoding of the user ID
34  // differs between the two types of DWARF.
36 
37  bool operator<(const DIERef &ref) const {
38  return die_offset < ref.die_offset;
39  }
40 
41  bool operator<(const DIERef &ref) { return die_offset < ref.die_offset; }
42 
43  explicit operator bool() const {
45  }
46 
49 };
50 
51 typedef std::vector<DIERef> DIEArray;
52 
53 #endif // SymbolFileDWARF_DIERef_h_
Definition: DIERef.h:18
bool operator<(const DIERef &ref) const
Definition: DIERef.h:37
std::vector< DIERef > DIEArray
Definition: DIERef.h:51
dw_offset_t die_offset
Definition: DIERef.h:48
uint64_t user_id_t
Definition: lldb-types.h:84
bool operator<(const DIERef &ref)
Definition: DIERef.h:41
lldb::user_id_t GetUID(SymbolFileDWARF *dwarf) const
Definition: DIERef.cpp:53
dw_offset_t cu_offset
Definition: DIERef.h:47
DIERef(dw_offset_t c, dw_offset_t d)
Definition: DIERef.h:21
DIERef()=default
#define DW_INVALID_OFFSET
Definition: dwarf.h:34