Go to the documentation of this file.
9 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DEBUGLOCSTREAM_H
10 #define LLVM_LIB_CODEGEN_ASMPRINTER_DEBUGLOCSTREAM_H
20 class DwarfCompileUnit;
51 std::vector<std::string> Comments;
56 bool GenerateComments;
59 DebugLocStream(
bool GenerateComments) : GenerateComments(GenerateComments) { }
81 size_t LI = Lists.size();
92 bool finalizeList(AsmPrinter &
Asm);
99 Entries.push_back({BeginSym, EndSym, DWARFBytes.size(), Comments.size()});
103 void finalizeEntry();
111 size_t LI = getIndex(L);
113 .slice(Lists[LI].EntryOffset, getNumEntries(LI));
117 size_t EI = getIndex(
E);
118 return makeArrayRef(DWARFBytes.begin(), DWARFBytes.end())
122 size_t EI = getIndex(
E);
124 .slice(Entries[EI].CommentOffset, getNumComments(EI));
128 size_t getIndex(
const List &L)
const {
129 assert(&Lists.front() <= &L && &L <= &Lists.back() &&
130 "Expected valid list");
131 return &L - &Lists.front();
133 size_t getIndex(
const Entry &
E)
const {
134 assert(&Entries.front() <= &
E && &
E <= &Entries.back() &&
135 "Expected valid entry");
136 return &
E - &Entries.front();
138 size_t getNumEntries(
size_t LI)
const {
139 if (LI + 1 == Lists.size())
140 return Entries.size() - Lists[LI].EntryOffset;
141 return Lists[LI + 1].EntryOffset - Lists[LI].EntryOffset;
144 if (EI + 1 == Entries.size())
145 return DWARFBytes.size() - Entries[EI].ByteOffset;
146 return Entries[EI + 1].ByteOffset - Entries[EI].ByteOffset;
148 size_t getNumComments(
size_t EI)
const {
149 if (EI + 1 == Entries.size())
150 return Comments.size() - Entries[EI].CommentOffset;
151 return Entries[EI + 1].CommentOffset - Entries[EI].CommentOffset;
167 : Locs(Locs), Asm(Asm), V(V),
MI(
MI), ListIndex(Locs.startList(&
CU)),
189 : Locs(
List.getLocs()) {
190 Locs.startEntry(Begin, End);
Byte stream of .debug_loc entries.
This is an optimization pass for GlobalISel generic memory operations.
BufferByteStreamer getStreamer()
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
const List & getList(size_t LI) const
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
BufferByteStreamer getStreamer()
ArrayRef< std::string > getComments(const Entry &E) const
ArrayRef< char > getBytes(const Entry &E) const
void setSym(MCSymbol *Sym)
~ListBuilder()
Finalize the list.
size_t getNumLists() const
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
void setTagOffset(uint8_t TO)
ListBuilder(DebugLocStream &Locs, DwarfCompileUnit &CU, AsmPrinter &Asm, DbgVariable &V, const MachineInstr &MI)
ArrayRef< List > getLists() const
This class is used to track local variable information.
Builder for DebugLocStream lists.
Representation of each machine instruction.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
DebugLocStream & getLocs()
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
DebugLocStream(bool GenerateComments)
Builder for DebugLocStream entries.
~EntryBuilder()
Finalize the entry, deleting it if it's empty.
static const SCEV * getNumBytes(const SCEV *BECount, Type *IntPtr, const SCEV *StoreSizeSCEV, Loop *CurLoop, const DataLayout *DL, ScalarEvolution *SE)
Compute the number of bytes as a SCEV from the backedge taken count.
This class is intended to be used as a driving class for all asm writers.
List(DwarfCompileUnit *CU, size_t EntryOffset)
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
EntryBuilder(ListBuilder &List, const MCSymbol *Begin, const MCSymbol *End)
MCSymbol * getSym() const
ArrayRef< Entry > getEntries(const List &L) const
reference emplace_back(ArgTypes &&... Args)