#ifndef LLVM_DWP_DWP_H
#define LLVM_DWP_DWP_H
#include "DWPStringPool.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/DebugInfo/DWARF/DWARFContext.h"
#include "llvm/DebugInfo/DWARF/DWARFUnitIndex.h"
#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Support/Error.h"
#include <deque>
#include <vector>
namespace llvm {
enum OnCuIndexOverflow { … };
struct UnitIndexEntry { … };
struct InfoSectionUnitHeader { … };
struct CompileUnitIdentifiers { … };
Error write(MCStreamer &Out, ArrayRef<std::string> Inputs,
OnCuIndexOverflow OverflowOptValue);
unsigned getContributionIndex(DWARFSectionKind Kind, uint32_t IndexVersion);
Error handleSection(
const StringMap<std::pair<MCSection *, DWARFSectionKind>> &KnownSections,
const MCSection *StrSection, const MCSection *StrOffsetSection,
const MCSection *TypesSection, const MCSection *CUIndexSection,
const MCSection *TUIndexSection, const MCSection *InfoSection,
const object::SectionRef &Section, MCStreamer &Out,
std::deque<SmallString<32>> &UncompressedSections,
uint32_t (&ContributionOffsets)[8], UnitIndexEntry &CurEntry,
StringRef &CurStrSection, StringRef &CurStrOffsetSection,
std::vector<StringRef> &CurTypesSection,
std::vector<StringRef> &CurInfoSection, StringRef &AbbrevSection,
StringRef &CurCUIndexSection, StringRef &CurTUIndexSection,
std::vector<std::pair<DWARFSectionKind, uint32_t>> &SectionLength);
Expected<InfoSectionUnitHeader> parseInfoSectionUnitHeader(StringRef Info);
void writeStringsAndOffsets(MCStreamer &Out, DWPStringPool &Strings,
MCSection *StrOffsetSection,
StringRef CurStrSection,
StringRef CurStrOffsetSection, uint16_t Version);
Error buildDuplicateError(const std::pair<uint64_t, UnitIndexEntry> &PrevE,
const CompileUnitIdentifiers &ID, StringRef DWPName);
void writeIndex(MCStreamer &Out, MCSection *Section,
ArrayRef<unsigned> ContributionOffsets,
const MapVector<uint64_t, UnitIndexEntry> &IndexEntries,
uint32_t IndexVersion);
}
#endif