1 //===-- DIERef.h ------------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef SymbolFileDWARF_DIERef_h_
11 #define SymbolFileDWARF_DIERef_h_
13 #include "lldb/Core/dwarf.h"
14 #include "lldb/lldb-defines.h"
17 class SymbolFileDWARF;
22 DIERef(dw_offset_t c, dw_offset_t d);
24 //----------------------------------------------------------------------
25 // In order to properly decode a lldb::user_id_t back into a DIERef we
26 // need the DWARF file since it knows if DWARF in .o files is being used
27 // (MacOSX) or if DWO files are being used. The encoding of the user ID
28 // differs between the two types of DWARF.
29 //----------------------------------------------------------------------
30 explicit DIERef(lldb::user_id_t uid, SymbolFileDWARF *dwarf);
32 explicit DIERef(const DWARFFormValue &form_value);
34 //----------------------------------------------------------------------
35 // In order to properly encode a DIERef unto a lldb::user_id_t we need
36 // the DWARF file since it knows if DWARF in .o files is being used
37 // (MacOSX) or if DWO files are being used. The encoding of the user ID
38 // differs between the two types of DWARF.
39 //----------------------------------------------------------------------
40 lldb::user_id_t GetUID(SymbolFileDWARF *dwarf) const;
42 bool operator<(const DIERef &ref) const {
43 return die_offset < ref.die_offset;
46 bool operator<(const DIERef &ref) { return die_offset < ref.die_offset; }
48 dw_offset_t cu_offset;
49 dw_offset_t die_offset;
52 typedef std::vector<DIERef> DIEArray;
54 #endif // SymbolFileDWARF_DIERef_h_