15 #ifndef LLVM_MC_MCDWARF_H
16 #define LLVM_MC_MCDWARF_H
50 :
Name(name), DirIndex(dirIndex) {}
53 void operator=(const
MCDwarfFile &) LLVM_DELETED_FUNCTION;
88 unsigned Discriminator;
91 #define DWARF2_LINE_DEFAULT_IS_STMT 1
93 #define DWARF2_FLAG_IS_STMT (1 << 0)
94 #define DWARF2_FLAG_BASIC_BLOCK (1 << 1)
95 #define DWARF2_FLAG_PROLOGUE_END (1 << 2)
96 #define DWARF2_FLAG_EPILOGUE_BEGIN (1 << 3)
101 MCDwarfLoc(
unsigned fileNum,
unsigned line,
unsigned column,
unsigned flags,
102 unsigned isa,
unsigned discriminator)
103 : FileNum(fileNum), Line(line), Column(column),
Flags(flags), Isa(isa),
104 Discriminator(discriminator) {}
145 Discriminator = discriminator;
191 MCLineDivisions[CUID].push_back(LineEntry);
207 return MCLineDivisions.count(CUID);
211 MCLineDivisionMap::const_iterator CIter = MCLineDivisions.find(CUID);
212 assert(CIter != MCLineDivisions.end());
213 return CIter->second;
232 static void Encode(
MCContext &Context, int64_t LineDelta, uint64_t AddrDelta,
236 static void Emit(
MCStreamer *MCOS, int64_t LineDelta, uint64_t AddrDelta);
264 : Name(name), FileNumber(fileNumber), LineNumber(lineNumber),
305 std::vector<char> Values;
308 : Operation(Op), Label(L), Register(R),
Offset(O),
313 MCCFIInstruction(
OpType Op, MCSymbol *L,
unsigned R1,
unsigned R2)
314 : Operation(Op), Label(L), Register(R1),
Register2(R2) {
433 return StringRef(&Values[0], Values.size());
460 bool usingCFI,
bool isEH);
const MCSymbol * Function
static void Emit(MCStreamer *MCOS, int64_t LineDelta, uint64_t AddrDelta)
Utility function to emit the encoding to a streamer.
const_iterator end(StringRef path)
Get end iterator over path.
unsigned getFileNumber() const
unsigned getColumn() const
getColumn - Get the Column of this MCDwarfLoc.
MCLineEntry(MCSymbol *label, const MCDwarfLoc loc)
void addLineEntry(const MCLineEntry &LineEntry, unsigned CUID)
static MCCFIInstruction createRememberState(MCSymbol *L)
.cfi_remember_state Save all current rules for all registers.
std::map< unsigned, MCLineEntryCollection > MCLineDivisionMap
static MCCFIInstruction createOffset(MCSymbol *L, unsigned Register, int Offset)
.cfi_offset Previous value of Register is saved at offset Offset from CFA.
MCLineEntryCollection::const_iterator const_iterator
unsigned getFileNum() const
getFileNum - Get the FileNum of this MCDwarfLoc.
const_iterator begin(StringRef path)
Get begin iterator over path.
const MCLineEntryCollection & getMCLineEntries(unsigned CUID) const
MCLineEntryCollection::iterator iterator
void setIsa(unsigned isa)
setIsa - Set the Isa of this MCDwarfLoc.
static MCCFIInstruction createDefCfaOffset(MCSymbol *L, int Offset)
.cfi_def_cfa_offset modifies a rule for computing CFA. Register remains the same, but offset is new...
static MCCFIInstruction createAdjustCfaOffset(MCSymbol *L, int Adjustment)
.cfi_adjust_cfa_offset Same as .cfi_def_cfa_offset, but Offset is a relative value that is added/subt...
static void Emit(MCStreamer *MCOS, const MCSymbol *LineSectionSymbol)
unsigned getRegister() const
void print(raw_ostream &OS) const
print - Print the value to the stream OS.
std::vector< MCCFIInstruction > Instructions
static MCCFIInstruction createUndefined(MCSymbol *L, unsigned Register)
.cfi_undefined From now on the previous value of Register can't be restored anymore.
static void Encode(MCContext &Context, int64_t LineDelta, uint64_t AddrDelta, raw_ostream &OS)
Utility function to encode a Dwarf pair of LineDelta and AddrDeltas.
static void Make(MCStreamer *MCOS, const MCSection *Section)
static void EmitAdvanceLoc(MCStreamer &Streamer, uint64_t AddrDelta)
unsigned getDirIndex() const
getDirIndex - Get the dirIndex of this MCDwarfFile.
unsigned getDiscriminator() const
getDiscriminator - Get the Discriminator of this MCDwarfLoc.
unsigned getLineNumber() const
ID
LLVM Calling Convention Representation.
void setLine(unsigned line)
setLine - Set the Line of this MCDwarfLoc.
void dump() const
dump - Print the value to stderr.
unsigned getLine() const
getLine - Get the Line of this MCDwarfLoc.
static MCCFIInstruction createSameValue(MCSymbol *L, unsigned Register)
.cfi_same_value Current value of Register is the same as in the previous frame. I.e., no restoration is needed.
StringRef getName() const
getName - Get the base name of this MCDwarfFile.
static MCCFIInstruction createDefCfa(MCSymbol *L, unsigned Register, int Offset)
.cfi_def_cfa defines a rule for computing CFA as: take address from Register and add Offset to it...
MCSymbol * getLabel() const
static MCCFIInstruction createDefCfaRegister(MCSymbol *L, unsigned Register)
.cfi_def_cfa_register modifies a rule for computing CFA. From now on Register will be used instead of...
static MCCFIInstruction createWindowSave(MCSymbol *L)
.cfi_window_save SPARC register window is saved.
static const MCSymbol * Emit(MCStreamer *MCOS)
static const MCSymbol * EmitCU(MCStreamer *MCOS, unsigned ID)
static MCCFIInstruction createRelOffset(MCSymbol *L, unsigned Register, int Offset)
.cfi_rel_offset Previous value of Register is saved at offset Offset from the current CFA register...
static MCCFIInstruction createRestore(MCSymbol *L, unsigned Register)
.cfi_restore says that the rule for Register is now the same as it was at the beginning of the functi...
unsigned PersonalityEncoding
std::vector< MCLineEntry > MCLineEntryCollection
static MCCFIInstruction createRestoreState(MCSymbol *L)
.cfi_restore_state Restore the previously saved state.
unsigned getIsa() const
getIsa - Get the Isa of this MCDwarfLoc.
bool containEntriesForID(unsigned CUID) const
OpType getOperation() const
const StringRef getValues() const
unsigned getRegister2() const
static void EncodeAdvanceLoc(MCContext &Context, uint64_t AddrDelta, raw_ostream &OS)
uint32_t CompactUnwindEncoding
unsigned getFlags() const
getFlags - Get the Flags of this MCDwarfLoc.
#define LLVM_DELETED_FUNCTION
static void Emit(MCStreamer &streamer, MCAsmBackend *MAB, bool usingCFI, bool isEH)
static void Make(MCSymbol *Symbol, MCStreamer *MCOS, SourceMgr &SrcMgr, SMLoc &Loc)
const MCSymbol * Personality
void setFileNum(unsigned fileNum)
setFileNum - Set the FileNum of this MCDwarfLoc.
void setFlags(unsigned flags)
setFlags - Set the Flags of this MCDwarfLoc.
raw_ostream & operator<<(raw_ostream &OS, const APInt &I)
MCGenDwarfLabelEntry(StringRef name, unsigned fileNumber, unsigned lineNumber, MCSymbol *label)
StringRef getName() const
MCAsmBackend - Generic interface to target specific assembler backends.
void setColumn(unsigned column)
setColumn - Set the Column of this MCDwarfLoc.
MCSymbol * getLabel() const
Represents a location in source code.
static MCCFIInstruction createEscape(MCSymbol *L, StringRef Vals)
.cfi_escape Allows the user to add arbitrary bytes to the unwind info.
MCSymbol * getLabel() const
void setDiscriminator(unsigned discriminator)
setDiscriminator - Set the Discriminator of this MCDwarfLoc.
static MCCFIInstruction createRegister(MCSymbol *L, unsigned Register1, unsigned Register2)
.cfi_register Previous value of Register1 is saved in register Register2.