[llvm] [cmake] Add possibility to use ChooseMSVCCRT.cmake when include LLVM library
[llvm-core.git] / include / llvm / DebugInfo / DWARF / DWARFDebugRnglists.h
blob952c41e188c7d272f3c125a335d46dc50584af91
1 //===- DWARFDebugRnglists.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 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_DEBUGINFO_DWARFDEBUGRNGLISTS_H
10 #define LLVM_DEBUGINFO_DWARFDEBUGRNGLISTS_H
12 #include "llvm/ADT/Optional.h"
13 #include "llvm/BinaryFormat/Dwarf.h"
14 #include "llvm/DebugInfo/DIContext.h"
15 #include "llvm/DebugInfo/DWARF/DWARFDataExtractor.h"
16 #include "llvm/DebugInfo/DWARF/DWARFDebugRangeList.h"
17 #include "llvm/DebugInfo/DWARF/DWARFListTable.h"
18 #include <cstdint>
19 #include <map>
20 #include <vector>
22 namespace llvm {
24 class Error;
25 class raw_ostream;
26 class DWARFUnit;
28 /// A class representing a single range list entry.
29 struct RangeListEntry : public DWARFListEntryBase {
30 /// The values making up the range list entry. Most represent a range with
31 /// a start and end address or a start address and a length. Others are
32 /// single value base addresses or end-of-list with no values. The unneeded
33 /// values are semantically undefined, but initialized to 0.
34 uint64_t Value0;
35 uint64_t Value1;
37 Error extract(DWARFDataExtractor Data, uint64_t End, uint64_t *OffsetPtr);
38 void dump(raw_ostream &OS, uint8_t AddrSize, uint8_t MaxEncodingStringLength,
39 uint64_t &CurrentBase, DIDumpOptions DumpOpts,
40 llvm::function_ref<Optional<object::SectionedAddress>(uint32_t)>
41 LookupPooledAddress) const;
42 bool isSentinel() const { return EntryKind == dwarf::DW_RLE_end_of_list; }
45 /// A class representing a single rangelist.
46 class DWARFDebugRnglist : public DWARFListType<RangeListEntry> {
47 public:
48 /// Build a DWARFAddressRangesVector from a rangelist.
49 DWARFAddressRangesVector
50 getAbsoluteRanges(llvm::Optional<object::SectionedAddress> BaseAddr,
51 DWARFUnit &U) const;
54 class DWARFDebugRnglistTable : public DWARFListTableBase<DWARFDebugRnglist> {
55 public:
56 DWARFDebugRnglistTable()
57 : DWARFListTableBase(/* SectionName = */ ".debug_rnglists",
58 /* HeaderString = */ "ranges:",
59 /* ListTypeString = */ "range") {}
62 } // end namespace llvm
64 #endif // LLVM_DEBUGINFO_DWARFDEBUGRNGLISTS_H