24void DWARFGdbIndex::dumpCUList(
raw_ostream &OS)
const {
25 OS <<
formatv(
"\n CU list offset = {0:x}, has {1} entries:", CuListOffset,
29 for (
const CompUnitEntry &CU : CuList)
30 OS <<
formatv(
" {0}: Offset = {1:x}, Length = {2:x}\n",
I++, CU.Offset,
34void DWARFGdbIndex::dumpTUList(
raw_ostream &OS)
const {
35 OS <<
formatv(
"\n Types CU list offset = {0:x}, has {1} entries:\n",
36 TuListOffset, TuList.size());
38 for (
const TypeUnitEntry &TU : TuList)
39 OS <<
formatv(
" {0}: offset = {1:x8}, type_offset = {2:x8}, "
40 "type_signature = {3:x16}\n",
41 I++, TU.Offset, TU.TypeOffset, TU.TypeSignature);
44void DWARFGdbIndex::dumpAddressArea(
raw_ostream &OS)
const {
45 OS <<
formatv(
"\n Address area offset = {0:x}, has {1} entries:",
46 AddressAreaOffset, AddressArea.size())
48 for (
const AddressEntry &Addr : AddressArea)
49 OS <<
formatv(
" Low/High address = [{0:x}, {1:x}) (Size: {2:x}), CU "
51 Addr.LowAddress, Addr.HighAddress,
52 Addr.HighAddress - Addr.LowAddress, Addr.CuIndex);
55void DWARFGdbIndex::dumpSymbolTable(
raw_ostream &OS)
const {
56 OS <<
formatv(
"\n Symbol table offset = {0:x}, size = {1}, filled slots:",
57 SymbolTableOffset, SymbolTable.size())
60 const auto FindCuVectorId = [&](uint32_t VecOffset) {
65 [](
const auto &ConstantPoolEntry, uint32_t
Offset) {
66 return ConstantPoolEntry.first <
Offset;
68 assert(It != ConstantPoolVectors.end() && It->first == VecOffset &&
69 "Invalid symbol table");
70 return It - ConstantPoolVectors.begin();
74 for (
const SymTableEntry &
E : SymbolTable) {
76 if (!
E.NameOffset && !
E.VecOffset)
79 OS <<
formatv(
" {0}: Name offset = {1:x}, CU vector offset = {2:x}\n",
I,
80 E.NameOffset,
E.VecOffset);
82 StringRef
Name = ConstantPoolStrings.substr(
83 ConstantPoolOffset - StringPoolOffset +
E.NameOffset);
85 const uint32_t CuVectorId = FindCuVectorId(
E.VecOffset);
86 OS <<
formatv(
" String name: {0}, CU vector index: {1}\n",
Name.data(),
91void DWARFGdbIndex::dumpConstantPool(
raw_ostream &OS)
const {
92 OS <<
formatv(
"\n Constant pool offset = {0:x}, has {1} CU vectors:",
93 ConstantPoolOffset, ConstantPoolVectors.size());
95 for (
const auto &V : ConstantPoolVectors) {
96 OS <<
formatv(
"\n {0}({1:x}): ",
I++,
V.first);
97 for (uint32_t Val :
V.second)
105 OS <<
"\n<error parsing>\n";
110 OS <<
" Version = " << Version <<
'\n';
115 dumpConstantPool(OS);
133 if (
Offset != CuListOffset)
136 uint32_t CuListSize = (TuListOffset - CuListOffset) / 16;
138 for (
uint32_t i = 0; i < CuListSize; ++i) {
146 uint32_t TuListSize = (AddressAreaOffset - TuListOffset) / 24;
147 TuList.resize(TuListSize);
148 for (uint32_t
I = 0;
I < TuListSize; ++
I) {
152 TuList[
I] = {CuOffset, TypeOffset, Signature};
155 uint32_t AddressAreaSize = (SymbolTableOffset - AddressAreaOffset) / 20;
156 AddressArea.reserve(AddressAreaSize);
157 for (uint32_t i = 0; i < AddressAreaSize; ++i) {
161 AddressArea.push_back({LowAddress, HighAddress, CuIndex});
172 uint32_t SymTableSize = (ConstantPoolOffset - SymbolTableOffset) / 8;
173 SymbolTable.reserve(SymTableSize);
174 std::set<uint32_t> CUOffsets;
175 for (uint32_t i = 0; i < SymTableSize; ++i) {
178 SymbolTable.push_back({NameOffset, CuVecOffset});
179 if (NameOffset || CuVecOffset)
180 CUOffsets.insert(CuVecOffset);
186 for (
auto CUOffset : CUOffsets) {
187 Offset = ConstantPoolOffset + CUOffset;
188 ConstantPoolVectors.emplace_back(0, SmallVector<uint32_t, 0>());
189 auto &Vec = ConstantPoolVectors.back();
190 Vec.first =
Offset - ConstantPoolOffset;
193 for (uint32_t J = 0; J < Num; ++J)
197 ConstantPoolStrings =
Data.getData().drop_front(
Offset);
198 StringPoolOffset =
Offset;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file defines the SmallVector class.
LLVM_ABI void dump(raw_ostream &OS)
LLVM_ABI void parse(DataExtractor Data)
void reserve(size_type N)
void push_back(const T &Elt)
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
auto lower_bound(R &&Range, T &&Value)
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...