LLVM 22.0.0git
DWP.h
Go to the documentation of this file.
1#ifndef LLVM_DWP_DWP_H
2#define LLVM_DWP_DWP_H
3
4#include "DWPStringPool.h"
5#include "llvm/ADT/ArrayRef.h"
10#include "llvm/MC/MCSection.h"
11#include "llvm/MC/MCStreamer.h"
14#include "llvm/Support/Error.h"
15#include <deque>
16#include <vector>
17
18namespace llvm {
24
26 Disabled, ///< Don't do any conversion of .debug_str_offsets tables.
27 Enabled, ///< Convert any .debug_str_offsets tables to DWARF64 if needed.
28 Always, ///< Always emit .debug_str_offsets talbes as DWARF64 for testing.
29};
30
37
38// Holds data for Skeleton, Split Compilation, and Type Unit Headers (only in
39// v5) as defined in Dwarf 5 specification, 7.5.1.2, 7.5.1.3 and Dwarf 4
40// specification 7.5.1.1.
42 // unit_length field. Note that the type is uint64_t even in 32-bit dwarf.
44
45 // version field.
47
48 // unit_type field. Initialized only if Version >= 5.
50
51 // address_size field.
53
54 // debug_abbrev_offset field. Note that the type is uint64_t even in 32-bit
55 // dwarf. It is assumed to be 0.
57
58 // dwo_id field. This resides in the header only if Version >= 5.
59 // In earlier versions, it is read from DW_AT_GNU_dwo_id.
60 std::optional<uint64_t> Signature;
61
62 // Derived from the length of Length field.
64
65 // The size of the Header in bytes. This is derived while parsing the header,
66 // and is stored as a convenience.
68};
69
72 const char *Name = "";
73 const char *DWOName = "";
74};
75
77 OnCuIndexOverflow OverflowOptValue,
78 Dwarf64StrOffsetsPromotion StrOffsetsOptValue);
79
80typedef std::vector<std::pair<DWARFSectionKind, uint32_t>> SectionLengths;
81
83 const StringMap<std::pair<MCSection *, DWARFSectionKind>> &KnownSections,
84 const MCSection *StrSection, const MCSection *StrOffsetSection,
85 const MCSection *TypesSection, const MCSection *CUIndexSection,
86 const MCSection *TUIndexSection, const MCSection *InfoSection,
87 const object::SectionRef &Section, MCStreamer &Out,
88 std::deque<SmallString<32>> &UncompressedSections,
89 uint32_t (&ContributionOffsets)[8], UnitIndexEntry &CurEntry,
90 StringRef &CurStrSection, StringRef &CurStrOffsetSection,
91 std::vector<StringRef> &CurTypesSection,
92 std::vector<StringRef> &CurInfoSection, StringRef &AbbrevSection,
93 StringRef &CurCUIndexSection, StringRef &CurTUIndexSection,
94 SectionLengths &SectionLength);
95
98
100 MCSection *StrOffsetSection,
101 StringRef CurStrSection,
102 StringRef CurStrOffsetSection,
104
106buildDuplicateError(const std::pair<uint64_t, UnitIndexEntry> &PrevE,
107 const CompileUnitIdentifiers &ID, StringRef DWPName);
108
109LLVM_ABI void
110writeIndex(MCStreamer &Out, MCSection *Section,
111 ArrayRef<unsigned> ContributionOffsets,
112 const MapVector<uint64_t, UnitIndexEntry> &IndexEntries,
113 uint32_t IndexVersion);
114
115} // namespace llvm
116#endif // LLVM_DWP_DWP_H
Analysis containing CSE Info
Definition CSEInfo.cpp:27
#define LLVM_ABI
Definition Compiler.h:213
This file implements a map that provides insertion order iteration.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
Lightweight error class with error context and mandatory checking.
Definition Error.h:159
Tagged union holding either a T or a Error.
Definition Error.h:485
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition MCSection.h:517
Streaming machine code generation interface.
Definition MCStreamer.h:220
This class implements a map that also provides access to all stored values in a deterministic order.
Definition MapVector.h:36
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
Definition SmallString.h:26
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition StringMap.h:133
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
This is a value type class that represents a single section in the list of sections in the object fil...
Definition ObjectFile.h:83
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition CallingConv.h:24
DwarfFormat
Constants that define the DWARF format as 32 or 64 bit.
Definition Dwarf.h:93
@ DWARF32
Definition Dwarf.h:93
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI Error buildDuplicateError(const std::pair< uint64_t, UnitIndexEntry > &PrevE, const CompileUnitIdentifiers &ID, StringRef DWPName)
Definition DWP.cpp:599
LLVM_ABI void writeIndex(MCStreamer &Out, MCSection *Section, ArrayRef< unsigned > ContributionOffsets, const MapVector< uint64_t, UnitIndexEntry > &IndexEntries, uint32_t IndexVersion)
Definition DWP.cpp:545
LLVM_ABI void writeStringsAndOffsets(MCStreamer &Out, DWPStringPool &Strings, MCSection *StrOffsetSection, StringRef CurStrSection, StringRef CurStrOffsetSection, uint16_t Version)
std::vector< std::pair< DWARFSectionKind, uint32_t > > SectionLengths
Definition DWP.h:80
FunctionAddr VTableAddr uintptr_t uintptr_t Version
Definition InstrProf.h:302
LLVM_ABI 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, SectionLengths &SectionLength)
Definition DWP.cpp:608
LLVM_ABI Error write(MCStreamer &Out, ArrayRef< std::string > Inputs, OnCuIndexOverflow OverflowOptValue, Dwarf64StrOffsetsPromotion StrOffsetsOptValue)
Definition DWP.cpp:677
LLVM_ABI Expected< InfoSectionUnitHeader > parseInfoSectionUnitHeader(StringRef Info)
Definition DWP.cpp:356
OnCuIndexOverflow
Definition DWP.h:19
@ SoftStop
Definition DWP.h:21
@ HardStop
Definition DWP.h:20
@ Continue
Definition DWP.h:22
Dwarf64StrOffsetsPromotion
Definition DWP.h:25
@ Enabled
Convert any .debug_str_offsets tables to DWARF64 if needed.
Definition DWP.h:27
@ Always
Always emit .debug_str_offsets talbes as DWARF64 for testing.
Definition DWP.h:28
@ Disabled
Don't do any conversion of .debug_str_offsets tables.
Definition DWP.h:26
const char * DWOName
Definition DWP.h:73
const char * Name
Definition DWP.h:72
dwarf::DwarfFormat Format
Definition DWP.h:63
std::optional< uint64_t > Signature
Definition DWP.h:60
uint64_t DebugAbbrevOffset
Definition DWP.h:56
StringRef DWPName
Definition DWP.h:35
std::string DWOName
Definition DWP.h:34
DWARFUnitIndex::Entry::SectionContribution Contributions[8]
Definition DWP.h:32
std::string Name
Definition DWP.h:33