#ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFFILE_H
#define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFFILE_H
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/FoldingSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Support/Allocator.h"
#include "AddressPool.h"
#include "DwarfStringPool.h"
#include <vector>
#include <string>
#include <memory>
namespace llvm {
class AsmPrinter;
class DwarfUnit;
class DIEAbbrev;
class MCSymbol;
class DIE;
class StringRef;
class DwarfDebug;
class MCSection;
class DwarfFile {
AsmPrinter *Asm;
FoldingSet<DIEAbbrev> AbbreviationsSet;
std::vector<DIEAbbrev *> Abbreviations;
SmallVector<std::unique_ptr<DwarfUnit>, 1> CUs;
DwarfStringPool StrPool;
public:
DwarfFile(AsmPrinter *AP, StringRef Pref, BumpPtrAllocator &DA);
~DwarfFile();
const SmallVectorImpl<std::unique_ptr<DwarfUnit>> &getUnits() { return CUs; }
unsigned computeSizeAndOffset(DIE &Die, unsigned Offset);
void computeSizeAndOffsets();
void assignAbbrevNumber(DIEAbbrev &Abbrev);
void addUnit(std::unique_ptr<DwarfUnit> U);
void emitUnits(DwarfDebug *DD, const MCSymbol *ASectionSym);
void emitAbbrevs(const MCSection *);
void emitStrings(const MCSection *StrSection,
const MCSection *OffsetSection = nullptr,
const MCSymbol *StrSecSym = nullptr);
DwarfStringPool &getStringPool() { return StrPool; }
};
}
#endif