1 //===-- llvm-dwarfdump - Debug info dumping utility -------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_TOOLS_LLVM_DWARFDUMP_LLVM_DWARFDUMP_H
10 #define LLVM_TOOLS_LLVM_DWARFDUMP_LLVM_DWARFDUMP_H
12 #include "llvm/ADT/MapVector.h"
13 #include "llvm/ADT/StringMap.h"
14 #include "llvm/ADT/Twine.h"
15 #include "llvm/DebugInfo/DWARF/DWARFContext.h"
16 #include "llvm/Object/ObjectFile.h"
17 #include "llvm/Support/raw_ostream.h"
22 /// Holds cumulative section sizes for an object file.
24 /// Map of .debug section names and their sizes across all such-named
26 MapVector
<std::string
, uint64_t, StringMap
<uint64_t>> DebugSectionSizes
;
27 /// Total number of bytes of all sections.
28 uint64_t TotalObjectSize
= 0;
29 /// Total number of bytes of all debug sections.
30 uint64_t TotalDebugSectionsSize
= 0;
33 /// Calculate the section sizes.
34 void calculateSectionSizes(const object::ObjectFile
&Obj
, SectionSizes
&Sizes
,
35 const Twine
&Filename
);
37 bool collectStatsForObjectFile(object::ObjectFile
&Obj
, DWARFContext
&DICtx
,
38 const Twine
&Filename
, raw_ostream
&OS
);
39 bool collectObjectSectionSizes(object::ObjectFile
&Obj
, DWARFContext
&DICtx
,
40 const Twine
&Filename
, raw_ostream
&OS
);
42 } // namespace dwarfdump