xref: /freebsd/contrib/llvm-project/llvm/lib/DebugInfo/DWARF/DWARFAddressRange.cpp (revision 81ad626541db97eb356e2c1d4a20eb2a26a766ab)
10b57cec5SDimitry Andric //===- DWARFDebugAranges.cpp ------------------------------------*- C++ -*-===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric 
90b57cec5SDimitry Andric #include "llvm/DebugInfo/DWARF/DWARFAddressRange.h"
10*81ad6265SDimitry Andric #include "llvm/DebugInfo/DIContext.h"
11480093f4SDimitry Andric #include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
120b57cec5SDimitry Andric #include "llvm/Support/raw_ostream.h"
130b57cec5SDimitry Andric 
140b57cec5SDimitry Andric using namespace llvm;
150b57cec5SDimitry Andric 
dump(raw_ostream & OS,uint32_t AddressSize,DIDumpOptions DumpOpts,const DWARFObject * Obj) const160b57cec5SDimitry Andric void DWARFAddressRange::dump(raw_ostream &OS, uint32_t AddressSize,
17480093f4SDimitry Andric                              DIDumpOptions DumpOpts,
18480093f4SDimitry Andric                              const DWARFObject *Obj) const {
190b57cec5SDimitry Andric 
200b57cec5SDimitry Andric   OS << (DumpOpts.DisplayRawContents ? " " : "[");
21e8d8bef9SDimitry Andric   DWARFFormValue::dumpAddress(OS, AddressSize, LowPC);
22e8d8bef9SDimitry Andric   OS << ", ";
23e8d8bef9SDimitry Andric   DWARFFormValue::dumpAddress(OS, AddressSize, HighPC);
240b57cec5SDimitry Andric   OS << (DumpOpts.DisplayRawContents ? "" : ")");
25480093f4SDimitry Andric 
26480093f4SDimitry Andric   if (Obj)
27480093f4SDimitry Andric     DWARFFormValue::dumpAddressSection(*Obj, OS, DumpOpts, SectionIndex);
280b57cec5SDimitry Andric }
290b57cec5SDimitry Andric 
operator <<(raw_ostream & OS,const DWARFAddressRange & R)300b57cec5SDimitry Andric raw_ostream &llvm::operator<<(raw_ostream &OS, const DWARFAddressRange &R) {
310b57cec5SDimitry Andric   R.dump(OS, /* AddressSize */ 8);
320b57cec5SDimitry Andric   return OS;
330b57cec5SDimitry Andric }
34