9 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DEBUGLOCSTREAM_H 10 #define LLVM_LIB_CODEGEN_ASMPRINTER_DEBUGLOCSTREAM_H 20 class DwarfCompileUnit;
38 : CU(CU), EntryOffset(EntryOffset) {}
51 std::vector<std::string> Comments;
56 bool GenerateComments;
59 DebugLocStream(
bool GenerateComments) : GenerateComments(GenerateComments) { }
81 size_t LI = Lists.
size();
99 Entries.
push_back({BeginSym, EndSym, DWARFBytes.
size(), Comments.size()});
103 void finalizeEntry();
111 size_t LI = getIndex(L);
117 size_t EI = getIndex(E);
122 size_t EI = getIndex(E);
124 .slice(Entries[EI].CommentOffset, getNumComments(EI));
128 size_t getIndex(
const List &L)
const {
130 "Expected valid list");
131 return &L - &Lists.
front();
133 size_t getIndex(
const Entry &
E)
const {
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;
166 : Locs(Locs), Asm(Asm), V(V), MI(MI), ListIndex(Locs.startList(&CU)) {}
183 : Locs(List.getLocs()) {
184 Locs.startEntry(Begin, End);
reference emplace_back(ArgTypes &&... Args)
Builder for DebugLocStream lists.
EntryBuilder(ListBuilder &List, const MCSymbol *Begin, const MCSymbol *End)
This class represents lattice values for constants.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
BufferByteStreamer getStreamer()
void push_back(const T &Elt)
ListBuilder(DebugLocStream &Locs, DwarfCompileUnit &CU, AsmPrinter &Asm, DbgVariable &V, const MachineInstr &MI)
DebugLocStream(bool GenerateComments)
DebugLocStream & getLocs()
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
This class is used to track local variable information.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
BufferByteStreamer getStreamer()
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
ArrayRef< char > getBytes(const Entry &E) const
This class is intended to be used as a driving class for all asm writers.
ArrayRef< Entry > getEntries(const List &L) const
MCSymbol * getSym() const
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
~EntryBuilder()
Finalize the entry, deleting it if it's empty.
static const SCEV * getNumBytes(const SCEV *BECount, Type *IntPtr, unsigned StoreSize, Loop *CurLoop, const DataLayout *DL, ScalarEvolution *SE)
Compute the number of bytes as a SCEV from the backedge taken count.
const List & getList(size_t LI) const
ArrayRef< std::string > getComments(const Entry &E) const
void setSym(MCSymbol *Sym)
Representation of each machine instruction.
size_t getNumLists() const
List(DwarfCompileUnit *CU, size_t EntryOffset)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Byte stream of .debug_loc entries.
Builder for DebugLocStream entries.
ArrayRef< List > getLists() const