60 "invalid integer write size: %zu",
Size);
66 std::vector<uint8_t> FillData(
Size, 0);
67 OS.
write(
reinterpret_cast<char *
>(FillData.data()),
Size);
72 bool IsLittleEndian) {
89 OS.
write(Str.data(), Str.size());
98 "Index should be less than the size of DebugAbbrev array");
99 auto [It, Inserted] = AbbrevTableContents.try_emplace(Index);
107 AbbrevCode = AbbrevDecl.Code ? (
uint64_t)*AbbrevDecl.Code : AbbrevCode + 1;
110 OS.
write(AbbrevDecl.Children);
111 for (
const auto &Attr : AbbrevDecl.Attributes) {
114 if (Attr.Form == dwarf::DW_FORM_implicit_const)
131 OS.
write(AbbrevTableContent.
data(), AbbrevTableContent.
size());
142 AddrSize = *
Range.AddrSize;
155 const uint64_t PaddedHeaderLength =
alignTo(HeaderLength, AddrSize * 2);
160 Length += PaddedHeaderLength - HeaderLength;
161 Length += AddrSize * 2 * (
Range.Descriptors.size() + 1);
171 for (
const auto &Descriptor :
Range.Descriptors) {
175 "unable to write debug_aranges address: %s",
187 const size_t RangesOffset = OS.
tell();
190 const size_t CurrOffset = OS.
tell() - RangesOffset;
191 if (DebugRanges.Offset && (
uint64_t)*DebugRanges.Offset < CurrOffset)
193 "'Offset' for 'debug_ranges' with index " +
195 " must be greater than or equal to the "
196 "number of bytes written already (0x" +
198 if (DebugRanges.Offset)
202 if (DebugRanges.AddrSize)
203 AddrSize = *DebugRanges.AddrSize;
206 for (
const auto &
Entry : DebugRanges.Entries) {
211 "unable to write debug_ranges address offset: %s",
224 bool IsLittleEndian,
bool IsGNUPubSec =
false) {
229 for (
const auto &Entry : Sect.
Entries) {
233 OS.
write(Entry.Name.data(), Entry.Name.size());
261template <
typename FormTy>
265 bool IsLittleEndian) {
266 auto FormIt = Forms.begin();
268 for (; FormIt != Forms.end() && FormVal != Values.
end();
269 ++FormIt, ++FormVal) {
275 case dwarf::DW_FORM_addr:
281 case dwarf::DW_FORM_ref_addr:
288 case dwarf::DW_FORM_exprloc:
289 case dwarf::DW_FORM_block:
294 case dwarf::DW_FORM_block1: {
300 case dwarf::DW_FORM_block2: {
306 case dwarf::DW_FORM_block4: {
312 case dwarf::DW_FORM_strx:
313 case dwarf::DW_FORM_addrx:
314 case dwarf::DW_FORM_rnglistx:
315 case dwarf::DW_FORM_loclistx:
316 case dwarf::DW_FORM_udata:
317 case dwarf::DW_FORM_ref_udata:
318 case dwarf::DW_FORM_GNU_addr_index:
319 case dwarf::DW_FORM_GNU_str_index:
322 case dwarf::DW_FORM_data1:
323 case dwarf::DW_FORM_ref1:
324 case dwarf::DW_FORM_flag:
325 case dwarf::DW_FORM_strx1:
326 case dwarf::DW_FORM_addrx1:
329 case dwarf::DW_FORM_data2:
330 case dwarf::DW_FORM_ref2:
331 case dwarf::DW_FORM_strx2:
332 case dwarf::DW_FORM_addrx2:
335 case dwarf::DW_FORM_data4:
336 case dwarf::DW_FORM_ref4:
337 case dwarf::DW_FORM_ref_sup4:
338 case dwarf::DW_FORM_strx4:
339 case dwarf::DW_FORM_addrx4:
342 case dwarf::DW_FORM_data8:
343 case dwarf::DW_FORM_ref8:
344 case dwarf::DW_FORM_ref_sup8:
345 case dwarf::DW_FORM_ref_sig8:
348 case dwarf::DW_FORM_sdata:
351 case dwarf::DW_FORM_string:
355 case dwarf::DW_FORM_indirect:
361 case dwarf::DW_FORM_strp:
362 case dwarf::DW_FORM_sec_offset:
363 case dwarf::DW_FORM_GNU_ref_alt:
364 case dwarf::DW_FORM_GNU_strp_alt:
365 case dwarf::DW_FORM_line_strp:
366 case dwarf::DW_FORM_strp_sup:
387 if (AbbrCode == 0 || Entry.Values.empty())
388 return OS.
tell() - EntryBegin;
392 if (!AbbrevTableInfoOrErr)
395 " for compilation unit with index " +
399 DI.
DebugAbbrev[AbbrevTableInfoOrErr->Index].Table);
401 if (AbbrCode > AbbrevDecls.
size())
404 "abbrev code must be less than or equal to the number of "
405 "entries in abbreviation table");
413 Entry.Values, Params, IsLittleEndian))
416 return OS.
tell() - EntryBegin;
433 case dwarf::DW_UT_compile:
434 case dwarf::DW_UT_partial:
437 case dwarf::DW_UT_type:
438 case dwarf::DW_UT_split_type:
442 case dwarf::DW_UT_skeleton:
443 case dwarf::DW_UT_split_compile:
452 std::string EntryBuffer;
462 return EntryLength.takeError();
479 AbbrevTableOffset = AbbrevTableInfoOrErr->Offset;
493 case dwarf::DW_UT_compile:
494 case dwarf::DW_UT_partial:
497 case dwarf::DW_UT_type:
498 case dwarf::DW_UT_split_type:
502 case dwarf::DW_UT_skeleton:
503 case dwarf::DW_UT_split_compile:
512 OS.
write(EntryBuffer.data(), EntryBuffer.size());
519 OS.
write(File.Name.data(), File.Name.size());
527 uint8_t AddrSize,
bool IsLittleEndian,
534 std::string OpBuffer;
537 switch (
Op.SubOpcode) {
538 case dwarf::DW_LNE_set_address:
542 case dwarf::DW_LNE_define_file:
545 case dwarf::DW_LNE_set_discriminator:
548 case dwarf::DW_LNE_end_sequence:
551 for (
auto OpByte :
Op.UnknownOpcodeData)
554 uint64_t ExtLen =
Op.ExtLen.value_or(OpBuffer.size());
556 OS.
write(OpBuffer.data(), OpBuffer.size());
563 if (
Op.Opcode == 0) {
565 }
else if (
Op.Opcode < OpcodeBase) {
567 case dwarf::DW_LNS_copy:
568 case dwarf::DW_LNS_negate_stmt:
569 case dwarf::DW_LNS_set_basic_block:
570 case dwarf::DW_LNS_const_add_pc:
571 case dwarf::DW_LNS_set_prologue_end:
572 case dwarf::DW_LNS_set_epilogue_begin:
575 case dwarf::DW_LNS_advance_pc:
576 case dwarf::DW_LNS_set_file:
577 case dwarf::DW_LNS_set_column:
578 case dwarf::DW_LNS_set_isa:
582 case dwarf::DW_LNS_advance_line:
586 case dwarf::DW_LNS_fixed_advance_pc:
591 for (
auto OpData :
Op.StandardOpcodeData) {
598static std::vector<uint8_t>
602 std::vector<uint8_t> StandardOpcodeLengths{0, 1, 1, 1, 1, 0,
606 StandardOpcodeLengths.resize(9);
607 }
else if (OpcodeBase) {
608 StandardOpcodeLengths.resize(*OpcodeBase > 0 ? *OpcodeBase - 1 : 0, 0);
610 return StandardOpcodeLengths;
615 OS << static_cast<char>(
Count);
616 for (
const auto [ContentType, Form] : Format) {
624 ArrayRef<std::vector<DWARFYAML::FormValue>> EntryList,
626 bool IsLittleEndian) {
633 Entry, Params, IsLittleEndian))
653 std::vector<uint8_t> StandardOpcodeLengths =
658 : StandardOpcodeLengths.size() + 1;
660 for (
uint8_t OpcodeLength : StandardOpcodeLengths)
684 BufferOS.
write(
'\0');
686 BufferOS.
write(
'\0');
690 BufferOS.
write(
'\0');
719 OS.
write(Buffer.data(), Buffer.size());
728 if (TableEntry.AddrSize)
729 AddrSize = *TableEntry.AddrSize;
734 if (TableEntry.Length)
738 Length = 4 + (AddrSize + TableEntry.SegSelectorSize) *
739 TableEntry.SegAddrPairs.size();
746 for (
const SegAddrPair &Pair : TableEntry.SegAddrPairs) {
747 if (TableEntry.SegSelectorSize != yaml::Hex8{0})
749 TableEntry.SegSelectorSize,
752 "unable to write debug_addr segment: %s",
758 "unable to write debug_addr address: %s",
790void emitDebugNamesHeader(
raw_ostream &OS,
bool IsLittleEndian,
794 StringRef AugmentationString =
"LLVM0700";
795 size_t TotalSize = CombinedSizeOtherParts + 5 *
sizeof(
uint32_t) +
796 2 *
sizeof(
uint16_t) +
sizeof(NameCount) +
797 sizeof(AbbrevSize) + AugmentationString.
size();
810 OS.
write(AugmentationString.
data(), AugmentationString.
size());
821 for (
auto [Idx, Form] : Abbrev.Indices) {
834std::string emitDebugNamesCUOffsets(
bool IsLittleEndian) {
836 raw_string_ostream OS(
Data);
845std::string emitDebugNamesNameTable(
847 const DenseMap<uint32_t, std::vector<DWARFYAML::DebugNameEntry>> &Entries,
848 ArrayRef<uint32_t> EntryPoolOffsets) {
849 assert(Entries.size() == EntryPoolOffsets.
size());
852 raw_string_ostream OS(
Data);
856 for (uint32_t PoolOffset : EntryPoolOffsets)
862DenseMap<uint32_t, std::vector<DWARFYAML::DebugNameEntry>>
864 DenseMap<uint32_t, std::vector<DWARFYAML::DebugNameEntry>> StrpToEntries;
865 for (
const DWARFYAML::DebugNameEntry &
Entry : Entries)
866 StrpToEntries[
Entry.NameStrp].push_back(
Entry);
867 return StrpToEntries;
872Expected<SmallVector<uint8_t>>
873getNonZeroDataSizesFor(uint32_t AbbrevCode,
875 const auto *AbbrevIt =
find_if(Abbrevs, [&](
const auto &
Abbrev) {
878 if (AbbrevIt == Abbrevs.
end())
880 "did not find an Abbreviation for this code");
882 SmallVector<uint8_t> DataSizes;
884 for (
auto [Idx, Form] : AbbrevIt->Indices) {
888 "unsupported Form for YAML debug_names emitter");
896struct PoolOffsetsAndData {
897 std::string PoolData;
898 std::vector<uint32_t> PoolOffsets;
905Expected<PoolOffsetsAndData> emitDebugNamesEntryPool(
907 const DenseMap<uint32_t, std::vector<DWARFYAML::DebugNameEntry>>
910 PoolOffsetsAndData
Result;
911 raw_string_ostream OS(
Result.PoolData);
917 for (
const DWARFYAML::DebugNameEntry &
Entry : EntriesWithSameName) {
920 Expected<SmallVector<uint8_t>> DataSizes =
921 getNonZeroDataSizesFor(
Entry.Code, Abbrevs);
927 "mismatch between provided and required number of values");
954 std::string NamesTableData = emitDebugNamesNameTable(
957 std::string AbbrevData = emitDebugNamesAbbrev(
DebugNames.Abbrevs);
958 std::string CUOffsetsData = emitDebugNamesCUOffsets(DI.
IsLittleEndian);
960 size_t TotalSize = PoolInfo->PoolData.size() + NamesTableData.size() +
961 AbbrevData.size() + CUOffsetsData.size();
965 AbbrevData.size(), TotalSize);
966 OS.
write(CUOffsetsData.data(), CUOffsetsData.size());
968 OS.
write(NamesTableData.data(), NamesTableData.size());
969 OS.
write(AbbrevData.data(), AbbrevData.size());
970 OS.
write(PoolInfo->PoolData.data(), PoolInfo->PoolData.size());
978 if (Values.
size() != ExpectedOperands)
981 "invalid number (%zu) of operands for the operator: %s, %" PRIu64
983 Values.
size(), EncodingString.
str().c_str(), ExpectedOperands);
990 bool IsLittleEndian) {
993 "unable to write address for the operator %s: %s",
994 EncodingName.
str().c_str(),
1000static Expected<uint64_t>
1003 uint8_t AddrSize,
bool IsLittleEndian) {
1004 auto CheckOperands = [&](
uint64_t ExpectedOperands) ->
Error {
1012 case dwarf::DW_OP_consts:
1013 if (
Error Err = CheckOperands(1))
1014 return std::move(Err);
1017 case dwarf::DW_OP_stack_value:
1018 if (
Error Err = CheckOperands(0))
1019 return std::move(Err);
1024 "DWARF expression: " +
1025 (EncodingStr.
empty()
1028 " is not supported");
1030 return OS.
tell() - ExpressionBegin;
1036 bool IsLittleEndian) {
1042 auto CheckOperands = [&](
uint64_t ExpectedOperands) ->
Error {
1051 switch (Entry.Operator) {
1052 case dwarf::DW_RLE_end_of_list:
1053 if (
Error Err = CheckOperands(0))
1054 return std::move(Err);
1056 case dwarf::DW_RLE_base_addressx:
1057 if (
Error Err = CheckOperands(1))
1058 return std::move(Err);
1061 case dwarf::DW_RLE_startx_endx:
1062 case dwarf::DW_RLE_startx_length:
1063 case dwarf::DW_RLE_offset_pair:
1064 if (
Error Err = CheckOperands(2))
1065 return std::move(Err);
1069 case dwarf::DW_RLE_base_address:
1070 if (
Error Err = CheckOperands(1))
1071 return std::move(Err);
1072 if (
Error Err = WriteAddress(Entry.Values[0]))
1073 return std::move(Err);
1075 case dwarf::DW_RLE_start_end:
1076 if (
Error Err = CheckOperands(2))
1077 return std::move(Err);
1078 if (
Error Err = WriteAddress(Entry.Values[0]))
1079 return std::move(Err);
1080 cantFail(WriteAddress(Entry.Values[1]));
1082 case dwarf::DW_RLE_start_length:
1083 if (
Error Err = CheckOperands(2))
1084 return std::move(Err);
1085 if (
Error Err = WriteAddress(Entry.Values[0]))
1086 return std::move(Err);
1091 return OS.
tell() - BeginOffset;
1097 bool IsLittleEndian) {
1103 auto CheckOperands = [&](
uint64_t ExpectedOperands) ->
Error {
1112 auto WriteDWARFOperations = [&]() ->
Error {
1113 std::string OpBuffer;
1120 DescriptionsLength += *OpSize;
1122 return OpSize.takeError();
1125 if (Entry.DescriptionsLength)
1126 DescriptionsLength = *Entry.DescriptionsLength;
1128 DescriptionsLength = OpBuffer.size();
1131 OS.
write(OpBuffer.data(), OpBuffer.size());
1136 switch (Entry.Operator) {
1137 case dwarf::DW_LLE_end_of_list:
1138 if (
Error Err = CheckOperands(0))
1139 return std::move(Err);
1141 case dwarf::DW_LLE_base_addressx:
1142 if (
Error Err = CheckOperands(1))
1143 return std::move(Err);
1146 case dwarf::DW_LLE_startx_endx:
1147 case dwarf::DW_LLE_startx_length:
1148 case dwarf::DW_LLE_offset_pair:
1149 if (
Error Err = CheckOperands(2))
1150 return std::move(Err);
1153 if (
Error Err = WriteDWARFOperations())
1154 return std::move(Err);
1156 case dwarf::DW_LLE_default_location:
1157 if (
Error Err = CheckOperands(0))
1158 return std::move(Err);
1159 if (
Error Err = WriteDWARFOperations())
1160 return std::move(Err);
1162 case dwarf::DW_LLE_base_address:
1163 if (
Error Err = CheckOperands(1))
1164 return std::move(Err);
1165 if (
Error Err = WriteAddress(Entry.Values[0]))
1166 return std::move(Err);
1168 case dwarf::DW_LLE_start_end:
1169 if (
Error Err = CheckOperands(2))
1170 return std::move(Err);
1171 if (
Error Err = WriteAddress(Entry.Values[0]))
1172 return std::move(Err);
1173 cantFail(WriteAddress(Entry.Values[1]));
1174 if (
Error Err = WriteDWARFOperations())
1175 return std::move(Err);
1177 case dwarf::DW_LLE_start_length:
1178 if (
Error Err = CheckOperands(2))
1179 return std::move(Err);
1180 if (
Error Err = WriteAddress(Entry.Values[0]))
1181 return std::move(Err);
1183 if (
Error Err = WriteDWARFOperations())
1184 return std::move(Err);
1188 return OS.
tell() - BeginOffset;
1191template <
typename EntryType>
1194 bool IsLittleEndian,
bool Is64BitAddrSize) {
1202 AddrSize = *Table.AddrSize;
1204 AddrSize = Is64BitAddrSize ? 8 : 4;
1210 std::string ListBuffer;
1216 std::vector<uint64_t> Offsets;
1219 Offsets.push_back(ListBufferOS.
tell());
1221 List.Content->writeAsBinary(ListBufferOS,
UINT64_MAX);
1222 Length += List.Content->binary_size();
1223 }
else if (List.Entries) {
1224 for (
const EntryType &Entry : *List.Entries) {
1239 if (Table.OffsetEntryCount)
1240 OffsetEntryCount = *Table.OffsetEntryCount;
1242 OffsetEntryCount = Table.Offsets ? Table.Offsets->size() : Offsets.size();
1266 Table.Offsets->size()),
1268 else if (OffsetEntryCount != 0)
1269 EmitOffsets(Offsets, OffsetsSize);
1271 OS.
write(ListBuffer.data(), ListBuffer.size());
1311 SecName +
" is not supported");
1319 StringMap<std::unique_ptr<MemoryBuffer>> &OutputBuffers) {
1325 if (
Error Err = EmitFunc(DebugInfoStream, DI))
1333Expected<StringMap<std::unique_ptr<MemoryBuffer>>>
1335 bool Is64BitAddrSize) {
1336 auto CollectDiagnostic = [](
const SMDiagnostic &Diag,
void *DiagContext) {
1341 yaml::Input YIn(YAMLString,
nullptr, CollectDiagnostic,
1360 return std::move(Err);
1361 return std::move(DebugSections);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file defines the StringMap class.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static void writeDWARFOffset(uint64_t Offset, dwarf::DwarfFormat Format, raw_ostream &OS, bool IsLittleEndian)
static Error writeFormValues(raw_ostream &OS, const FormTy &Forms, ArrayRef< DWARFYAML::FormValue > Values, const dwarf::FormParams &Params, bool IsLittleEndian)
static Error emitDebugSectionImpl(const DWARFYAML::Data &DI, StringRef Sec, StringMap< std::unique_ptr< MemoryBuffer > > &OutputBuffers)
static void ZeroFillBytes(raw_ostream &OS, size_t Size)
static Error writeV5Entry(raw_ostream &OS, uint64_t Count, ArrayRef< DWARFYAML::LnctForm > Format, ArrayRef< std::vector< DWARFYAML::FormValue > > EntryList, const dwarf::FormParams &Params, bool IsLittleEndian)
static void emitFileEntry(raw_ostream &OS, const DWARFYAML::File &File)
static Error writeDWARFLists(raw_ostream &OS, ArrayRef< DWARFYAML::ListTable< EntryType > > Tables, bool IsLittleEndian, bool Is64BitAddrSize)
static void writeV5EntryFormat(raw_ostream &OS, uint8_t Count, ArrayRef< DWARFYAML::LnctForm > Format)
static void writeLineTableOpcode(const DWARFYAML::LineTableOpcode &Op, uint8_t OpcodeBase, uint8_t AddrSize, raw_ostream &OS, bool IsLittleEndian)
static Error writeVariableSizedInteger(uint64_t Integer, size_t Size, raw_ostream &OS, bool IsLittleEndian)
static Expected< uint64_t > writeListEntry(raw_ostream &OS, const DWARFYAML::RnglistEntry &Entry, uint8_t AddrSize, bool IsLittleEndian)
static void writeInteger(T Integer, raw_ostream &OS, bool IsLittleEndian)
static void writeExtendedOpcode(const DWARFYAML::LineTableOpcode &Op, uint8_t AddrSize, bool IsLittleEndian, raw_ostream &OS)
static Error checkOperandCount(StringRef EncodingString, ArrayRef< yaml::Hex64 > Values, uint64_t ExpectedOperands)
static Expected< uint64_t > writeDWARFExpression(raw_ostream &OS, const DWARFYAML::DWARFOperation &Operation, uint8_t AddrSize, bool IsLittleEndian)
static Error emitPubSection(raw_ostream &OS, const DWARFYAML::PubSection &Sect, bool IsLittleEndian, bool IsGNUPubSec=false)
static Expected< uint64_t > writeDIE(const DWARFYAML::Data &DI, uint64_t CUIndex, uint64_t AbbrevTableID, const dwarf::FormParams &Params, const DWARFYAML::Entry &Entry, raw_ostream &OS, bool IsLittleEndian)
static void writeInitialLength(const dwarf::DwarfFormat Format, const uint64_t Length, raw_ostream &OS, bool IsLittleEndian)
static std::vector< uint8_t > getStandardOpcodeLengths(uint16_t Version, std::optional< uint8_t > OpcodeBase)
static Error writeListEntryAddress(StringRef EncodingName, raw_ostream &OS, uint64_t Addr, uint8_t AddrSize, bool IsLittleEndian)
Common declarations for yaml2obj.
This file declares classes for handling the YAML representation of DWARF Debug Info.
This file contains constants used for implementing Dwarf debug support.
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
PowerPC Reduce CR logical Operation
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
Error takeError()
Take ownership of the stored error.
static std::unique_ptr< MemoryBuffer > getMemBufferCopy(StringRef InputData, const Twine &BufferName="")
Open the specified memory range as a MemoryBuffer, copying the contents and taking ownership of it.
Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a ca...
StringRef getMessage() const
void push_back(const T &Elt)
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
StringRef - Represent a constant reference to a string, i.e.
std::string str() const
str - Get the contents as an std::string.
constexpr bool empty() const
empty - Check if the string is empty.
constexpr size_t size() const
size - Get the string size.
constexpr const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static Twine utohexstr(uint64_t Val)
This class implements an extremely fast bulk output stream that can only output to a stream.
raw_ostream & write_zeros(unsigned NumZeros)
write_zeros - Insert 'NumZeros' nulls.
uint64_t tell() const
tell - Return the current offset with the file.
raw_ostream & write(unsigned char C)
A raw_ostream that writes to an std::string.
LLVM_ABI StringRef RangeListEncodingString(unsigned Encoding)
LLVM_ABI StringRef LocListEncodingString(unsigned Encoding)
LLVM_ABI StringRef OperationEncodingString(unsigned Encoding)
LLVM_ABI Error emitDebugStrOffsets(raw_ostream &OS, const Data &DI)
LLVM_ABI Error emitDebugInfo(raw_ostream &OS, const Data &DI)
LLVM_ABI Error emitDebugRanges(raw_ostream &OS, const Data &DI)
LLVM_ABI Error emitDebugAranges(raw_ostream &OS, const Data &DI)
LLVM_ABI Error emitDebugGNUPubnames(raw_ostream &OS, const Data &DI)
LLVM_ABI Error emitDebugAbbrev(raw_ostream &OS, const Data &DI)
LLVM_ABI Error emitDebugRnglists(raw_ostream &OS, const Data &DI)
LLVM_ABI Error emitDebugLoclists(raw_ostream &OS, const Data &DI)
LLVM_ABI std::function< Error(raw_ostream &, const Data &)> getDWARFEmitterByName(StringRef SecName)
LLVM_ABI Expected< StringMap< std::unique_ptr< MemoryBuffer > > > emitDebugSections(StringRef YAMLString, bool IsLittleEndian=sys::IsLittleEndianHost, bool Is64BitAddrSize=true)
LLVM_ABI Error emitDebugGNUPubtypes(raw_ostream &OS, const Data &DI)
LLVM_ABI Error emitDebugStr(raw_ostream &OS, const Data &DI)
LLVM_ABI Error emitDebugPubnames(raw_ostream &OS, const Data &DI)
LLVM_ABI Error emitDebugAddr(raw_ostream &OS, const Data &DI)
LLVM_ABI Error emitDebugNames(raw_ostream &OS, const Data &DI)
LLVM_ABI Error emitDebugPubtypes(raw_ostream &OS, const Data &DI)
LLVM_ABI Error emitDebugLine(raw_ostream &OS, const Data &DI)
DwarfFormat
Constants that define the DWARF format as 32 or 64 bit.
LLVM_ABI std::optional< uint8_t > getFixedFormByteSize(dwarf::Form Form, FormParams Params)
Get the fixed byte size for a given form.
@ DW_LENGTH_DWARF64
Indicator of 64-bit DWARF format.
constexpr bool IsLittleEndianHost
void swapByteOrder(T &Value)
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr Value
detail::zippy< detail::zip_first, T, U, Args... > zip_equal(T &&t, U &&u, Args &&...args)
zip iterator that assumes that all iteratees have the same length.
LLVM_ABI std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
SmallVectorImpl< T >::const_pointer c_str(SmallVectorImpl< T > &str)
std::string utohexstr(uint64_t X, bool LowerCase=false, unsigned Width=0)
std::string utostr(uint64_t X, bool isNeg=false)
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
auto map_range(ContainerTy &&C, FuncTy F)
Return a range that applies F to the elements of C.
Error joinErrors(Error E1, Error E2)
Concatenate errors.
auto make_first_range(ContainerTy &&c)
Given a container of pairs, return a range over the first elements.
constexpr uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
FunctionAddr VTableAddr Count
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
FunctionAddr VTableAddr uintptr_t uintptr_t Data
DWARFExpression::Operation Op
ArrayRef(const T &OneElt) -> ArrayRef< T >
std::string toString(const APInt &I, unsigned Radix, bool Signed, bool formatAsCLiteral=false, bool UpperCase=true, bool InsertSeparators=false)
auto make_second_range(ContainerTy &&c)
Given a container of pairs, return a range over the second elements.
unsigned encodeSLEB128(int64_t Value, raw_ostream &OS, unsigned PadTo=0)
Utility function to encode a SLEB128 value to an output stream.
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.
unsigned encodeULEB128(uint64_t Value, raw_ostream &OS, unsigned PadTo=0)
Utility function to encode a ULEB128 value to an output stream.
void consumeError(Error Err)
Consume a Error without doing anything.
std::vector< AttributeAbbrev > Attributes
std::optional< yaml::Hex64 > Code
std::vector< Unit > Units
std::vector< LineTable > DebugLines
std::optional< std::vector< AddrTableEntry > > DebugAddr
std::optional< std::vector< Ranges > > DebugRanges
std::optional< std::vector< ListTable< LoclistEntry > > > DebugLoclists
std::vector< AbbrevTable > DebugAbbrev
LLVM_ABI Expected< AbbrevTableInfo > getAbbrevTableInfoByID(uint64_t ID) const
std::optional< PubSection > GNUPubNames
std::optional< std::vector< ARange > > DebugAranges
LLVM_ABI StringRef getAbbrevTableContentByIndex(uint64_t Index) const
std::optional< PubSection > GNUPubTypes
LLVM_ABI SetVector< StringRef > getNonEmptySectionNames() const
std::optional< std::vector< StringOffsetsTable > > DebugStrOffsets
std::optional< std::vector< StringRef > > DebugStrings
std::optional< std::vector< ListTable< RnglistEntry > > > DebugRnglists
std::optional< PubSection > PubNames
std::optional< DebugNamesSection > DebugNames
std::optional< PubSection > PubTypes
std::vector< FormValue > Values
uint8_t FileNameEntryFormatCount
std::vector< std::vector< FormValue > > FileNames
std::optional< uint64_t > Length
std::optional< uint8_t > OpcodeBase
std::vector< LineTableOpcode > Opcodes
std::optional< uint64_t > PrologueLength
dwarf::DwarfFormat Format
std::vector< File > Files
uint64_t DirectoriesCount
std::vector< StringRef > IncludeDirs
std::vector< LnctForm > DirectoryEntryFormat
std::vector< LnctForm > FileNameEntryFormat
std::optional< std::vector< uint8_t > > StandardOpcodeLengths
uint8_t DirectoryEntryFormatCount
uint8_t SegmentSelectorSize
std::vector< std::vector< FormValue > > Directories
dwarf::DwarfFormat Format
std::vector< PubEntry > Entries
std::optional< yaml::Hex64 > Length
std::vector< yaml::Hex64 > Offsets
dwarf::DwarfFormat Format
std::optional< uint64_t > AbbrevTableID
dwarf::DwarfFormat Format
std::optional< yaml::Hex64 > Length
yaml::Hex64 TypeSignatureOrDwoID
std::optional< uint8_t > AddrSize
llvm::dwarf::UnitType Type
std::vector< Entry > Entries
std::optional< yaml::Hex64 > AbbrOffset