[DebugInfo] Avoid re-ordering assignments in LCSSA
[llvm-project.git] / llvm / tools / llvm-dwarfdump / llvm-dwarfdump.h
blobdc41298265d2a5a4932ec509ece4463b69b9e247
1 //===-- llvm-dwarfdump - Debug info dumping utility -------------*- 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_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"
17 namespace llvm {
18 namespace dwarfdump {
20 /// Holds cumulative section sizes for an object file.
21 struct SectionSizes {
22 /// Map of .debug section names and their sizes across all such-named
23 /// sections.
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
41 } // namespace llvm
43 #endif