DWARFAddressRange.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. //===- DWARFDebugAranges.cpp ------------------------------------*- 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. #include "llvm/DebugInfo/DWARF/DWARFAddressRange.h"
  9. #include "llvm/DebugInfo/DWARF/DWARFFormValue.h"
  10. #include "llvm/Support/Format.h"
  11. #include "llvm/Support/raw_ostream.h"
  12. using namespace llvm;
  13. void DWARFAddressRange::dump(raw_ostream &OS, uint32_t AddressSize,
  14. DIDumpOptions DumpOpts,
  15. const DWARFObject *Obj) const {
  16. OS << (DumpOpts.DisplayRawContents ? " " : "[");
  17. DWARFFormValue::dumpAddress(OS, AddressSize, LowPC);
  18. OS << ", ";
  19. DWARFFormValue::dumpAddress(OS, AddressSize, HighPC);
  20. OS << (DumpOpts.DisplayRawContents ? "" : ")");
  21. if (Obj)
  22. DWARFFormValue::dumpAddressSection(*Obj, OS, DumpOpts, SectionIndex);
  23. }
  24. raw_ostream &llvm::operator<<(raw_ostream &OS, const DWARFAddressRange &R) {
  25. R.dump(OS, /* AddressSize */ 8);
  26. return OS;
  27. }