Path: blob/main/contrib/llvm-project/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.h
35231 views
//===-- llvm-dwarfdump - Debug info dumping utility -------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLVM_TOOLS_LLVM_DWARFDUMP_LLVM_DWARFDUMP_H9#define LLVM_TOOLS_LLVM_DWARFDUMP_LLVM_DWARFDUMP_H1011#include "llvm/ADT/MapVector.h"12#include "llvm/ADT/StringMap.h"13#include "llvm/ADT/Twine.h"14#include "llvm/DebugInfo/DWARF/DWARFContext.h"15#include "llvm/Object/ObjectFile.h"16#include "llvm/Support/raw_ostream.h"1718namespace llvm {19namespace dwarfdump {2021/// Holds cumulative section sizes for an object file.22struct SectionSizes {23/// Map of .debug section names and their sizes across all such-named24/// sections.25MapVector<std::string, uint64_t, StringMap<uint64_t>> DebugSectionSizes;26/// Total number of bytes of all sections.27uint64_t TotalObjectSize = 0;28/// Total number of bytes of all debug sections.29uint64_t TotalDebugSectionsSize = 0;30};3132/// Calculate the section sizes.33void calculateSectionSizes(const object::ObjectFile &Obj, SectionSizes &Sizes,34const Twine &Filename);3536bool collectStatsForObjectFile(object::ObjectFile &Obj, DWARFContext &DICtx,37const Twine &Filename, raw_ostream &OS);38bool collectObjectSectionSizes(object::ObjectFile &Obj, DWARFContext &DICtx,39const Twine &Filename, raw_ostream &OS);4041} // namespace dwarfdump42} // namespace llvm4344#endif454647