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/Twine.h"
13 #include "llvm/DebugInfo/DWARF/DWARFContext.h"
14 #include "llvm/Object/ObjectFile.h"
15 #include "llvm/Support/raw_ostream.h"
20 /// Holds cumulative section sizes for an object file.
22 /// Map of .debug section names and their sizes across all such-named
24 StringMap
<uint64_t> DebugSectionSizes
;
25 /// Total number of bytes of all sections.
26 uint64_t TotalObjectSize
= 0;
27 /// Total number of bytes of all debug sections.
28 uint64_t TotalDebugSectionsSize
= 0;
31 /// Calculate the section sizes.
32 void calculateSectionSizes(const object::ObjectFile
&Obj
, SectionSizes
&Sizes
,
33 const Twine
&Filename
);
35 bool collectStatsForObjectFile(object::ObjectFile
&Obj
, DWARFContext
&DICtx
,
36 const Twine
&Filename
, raw_ostream
&OS
);
37 bool collectObjectSectionSizes(object::ObjectFile
&Obj
, DWARFContext
&DICtx
,
38 const Twine
&Filename
, raw_ostream
&OS
);
40 } // namespace dwarfdump