xref: /freebsd/contrib/llvm-project/llvm/lib/DebugInfo/DWARF/DWARFAddressRange.cpp (revision e8d8bef961a50d4dc22501cde4fb9fb0be1b2532)
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"
10480093f4SDimitry Andric #include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
110b57cec5SDimitry Andric #include "llvm/Support/Format.h"
120b57cec5SDimitry Andric #include "llvm/Support/raw_ostream.h"
130b57cec5SDimitry Andric 
140b57cec5SDimitry Andric using namespace llvm;
150b57cec5SDimitry Andric 
160b57cec5SDimitry 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 ? " " : "[");
21*e8d8bef9SDimitry Andric   DWARFFormValue::dumpAddress(OS, AddressSize, LowPC);
22*e8d8bef9SDimitry Andric   OS << ", ";
23*e8d8bef9SDimitry 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 
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