[InstCombine] Signed saturation patterns
[llvm-core.git] / include / llvm / DebugInfo / DWARF / DWARFGdbIndex.h
blob38cd42ddb88389804240bdf1219d16e84e65abfc
1 //===- DWARFGdbIndex.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_DWARF_DWARFGDBINDEX_H
10 #define LLVM_DEBUGINFO_DWARF_DWARFGDBINDEX_H
12 #include "llvm/ADT/SmallVector.h"
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/Support/DataExtractor.h"
15 #include <cstdint>
16 #include <utility>
18 namespace llvm {
20 class raw_ostream;
22 class DWARFGdbIndex {
23 uint32_t Version;
25 uint32_t CuListOffset;
26 uint32_t TuListOffset;
27 uint32_t AddressAreaOffset;
28 uint32_t SymbolTableOffset;
29 uint32_t ConstantPoolOffset;
31 struct CompUnitEntry {
32 uint64_t Offset; /// Offset of a CU in the .debug_info section.
33 uint64_t Length; /// Length of that CU.
35 SmallVector<CompUnitEntry, 0> CuList;
37 struct TypeUnitEntry {
38 uint64_t Offset;
39 uint64_t TypeOffset;
40 uint64_t TypeSignature;
42 SmallVector<TypeUnitEntry, 0> TuList;
44 struct AddressEntry {
45 uint64_t LowAddress; /// The low address.
46 uint64_t HighAddress; /// The high address.
47 uint32_t CuIndex; /// The CU index.
49 SmallVector<AddressEntry, 0> AddressArea;
51 struct SymTableEntry {
52 uint32_t NameOffset; /// Offset of the symbol's name in the constant pool.
53 uint32_t VecOffset; /// Offset of the CU vector in the constant pool.
55 SmallVector<SymTableEntry, 0> SymbolTable;
57 /// Each value is CU index + attributes.
58 SmallVector<std::pair<uint32_t, SmallVector<uint32_t, 0>>, 0>
59 ConstantPoolVectors;
61 StringRef ConstantPoolStrings;
62 uint32_t StringPoolOffset;
64 void dumpCUList(raw_ostream &OS) const;
65 void dumpTUList(raw_ostream &OS) const;
66 void dumpAddressArea(raw_ostream &OS) const;
67 void dumpSymbolTable(raw_ostream &OS) const;
68 void dumpConstantPool(raw_ostream &OS) const;
70 bool parseImpl(DataExtractor Data);
72 public:
73 void dump(raw_ostream &OS);
74 void parse(DataExtractor Data);
76 bool HasContent = false;
77 bool HasError = false;
80 } // end namespace llvm
82 #endif // LLVM_DEBUGINFO_DWARF_DWARFGDBINDEX_H