10 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DEBUGLOCSTREAM_H 11 #define LLVM_LIB_CODEGEN_ASMPRINTER_DEBUGLOCSTREAM_H 21 class DwarfCompileUnit;
39 : CU(CU), EntryOffset(EntryOffset) {}
48 : BeginSym(BeginSym), EndSym(EndSym), ByteOffset(ByteOffset),
49 CommentOffset(CommentOffset) {}
60 bool GenerateComments;
63 DebugLocStream(
bool GenerateComments) : GenerateComments(GenerateComments) { }
79 size_t LI = Lists.
size();
101 void finalizeEntry();
109 size_t LI = getIndex(L);
115 size_t EI = getIndex(E);
120 size_t EI = getIndex(E);
122 .slice(Entries[EI].CommentOffset, getNumComments(EI));
126 size_t getIndex(
const List &L)
const {
128 "Expected valid list");
129 return &L - &Lists.
front();
131 size_t getIndex(
const Entry &
E)
const {
133 "Expected valid entry");
134 return &E - &Entries.
front();
136 size_t getNumEntries(
size_t LI)
const {
137 if (LI + 1 == Lists.
size())
138 return Entries.
size() - Lists[LI].EntryOffset;
139 return Lists[LI + 1].EntryOffset - Lists[LI].EntryOffset;
142 if (EI + 1 == Entries.
size())
143 return DWARFBytes.
size() - Entries[EI].ByteOffset;
144 return Entries[EI + 1].ByteOffset - Entries[EI].ByteOffset;
146 size_t getNumComments(
size_t EI)
const {
147 if (EI + 1 == Entries.
size())
148 return Comments.
size() - Entries[EI].CommentOffset;
149 return Entries[EI + 1].CommentOffset - Entries[EI].CommentOffset;
164 : Locs(Locs), Asm(Asm), V(V), MI(MI), ListIndex(Locs.startList(&CU)) {}
181 : Locs(List.getLocs()) {
182 Locs.startEntry(Begin, End);
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()
ListBuilder(DebugLocStream &Locs, DwarfCompileUnit &CU, AsmPrinter &Asm, DbgVariable &V, const MachineInstr &MI)
DebugLocStream(bool GenerateComments)
DebugLocStream & getLocs()
const MCSymbol * BeginSym
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")
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
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
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.
Entry(const MCSymbol *BeginSym, const MCSymbol *EndSym, size_t ByteOffset, size_t CommentOffset)
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
Representation of each machine instruction.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
void emplace_back(ArgTypes &&... Args)
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