LLVM  7.0.0svn
MCDwarf.h
Go to the documentation of this file.
1 //===- MCDwarf.h - Machine Code Dwarf support -------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the declaration of the MCDwarfFile to support the dwarf
11 // .file directive and the .loc directive.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_MC_MCDWARF_H
16 #define LLVM_MC_MCDWARF_H
17 
18 #include "llvm/ADT/MapVector.h"
19 #include "llvm/ADT/SmallVector.h"
20 #include "llvm/ADT/StringMap.h"
21 #include "llvm/ADT/StringRef.h"
22 #include "llvm/MC/MCSection.h"
23 #include "llvm/Support/MD5.h"
24 #include <cassert>
25 #include <cstdint>
26 #include <string>
27 #include <utility>
28 #include <vector>
29 
30 namespace llvm {
31 
32 template <typename T> class ArrayRef;
33 class MCAsmBackend;
34 class MCContext;
35 class MCDwarfLineStr;
36 class MCObjectStreamer;
37 class MCStreamer;
38 class MCSymbol;
39 class raw_ostream;
40 class SMLoc;
41 class SourceMgr;
42 
43 /// \brief Instances of this class represent the name of the dwarf
44 /// .file directive and its associated dwarf file number in the MC file,
45 /// and MCDwarfFile's are created and uniqued by the MCContext class where
46 /// the file number for each is its index into the vector of DwarfFiles (note
47 /// index 0 is not used and not a valid dwarf file number).
48 struct MCDwarfFile {
49  // \brief The base name of the file without its directory path.
50  // The StringRef references memory allocated in the MCContext.
51  std::string Name;
52 
53  // \brief The index into the list of directory names for this file name.
54  unsigned DirIndex;
55 
56  /// The MD5 checksum, if there is one. Non-owning pointer to data allocated
57  /// in MCContext.
59 };
60 
61 /// \brief Instances of this class represent the information from a
62 /// dwarf .loc directive.
63 class MCDwarfLoc {
64  uint32_t FileNum;
65  uint32_t Line;
66  uint16_t Column;
67  // Flags (see #define's below)
68  uint8_t Flags;
69  uint8_t Isa;
70  uint32_t Discriminator;
71 
72 // Flag that indicates the initial value of the is_stmt_start flag.
73 #define DWARF2_LINE_DEFAULT_IS_STMT 1
74 
75 #define DWARF2_FLAG_IS_STMT (1 << 0)
76 #define DWARF2_FLAG_BASIC_BLOCK (1 << 1)
77 #define DWARF2_FLAG_PROLOGUE_END (1 << 2)
78 #define DWARF2_FLAG_EPILOGUE_BEGIN (1 << 3)
79 
80 private: // MCContext manages these
81  friend class MCContext;
82  friend class MCDwarfLineEntry;
83 
84  MCDwarfLoc(unsigned fileNum, unsigned line, unsigned column, unsigned flags,
85  unsigned isa, unsigned discriminator)
86  : FileNum(fileNum), Line(line), Column(column), Flags(flags), Isa(isa),
87  Discriminator(discriminator) {}
88 
89  // Allow the default copy constructor and assignment operator to be used
90  // for an MCDwarfLoc object.
91 
92 public:
93  /// \brief Get the FileNum of this MCDwarfLoc.
94  unsigned getFileNum() const { return FileNum; }
95 
96  /// \brief Get the Line of this MCDwarfLoc.
97  unsigned getLine() const { return Line; }
98 
99  /// \brief Get the Column of this MCDwarfLoc.
100  unsigned getColumn() const { return Column; }
101 
102  /// \brief Get the Flags of this MCDwarfLoc.
103  unsigned getFlags() const { return Flags; }
104 
105  /// \brief Get the Isa of this MCDwarfLoc.
106  unsigned getIsa() const { return Isa; }
107 
108  /// \brief Get the Discriminator of this MCDwarfLoc.
109  unsigned getDiscriminator() const { return Discriminator; }
110 
111  /// \brief Set the FileNum of this MCDwarfLoc.
112  void setFileNum(unsigned fileNum) { FileNum = fileNum; }
113 
114  /// \brief Set the Line of this MCDwarfLoc.
115  void setLine(unsigned line) { Line = line; }
116 
117  /// \brief Set the Column of this MCDwarfLoc.
118  void setColumn(unsigned column) {
119  assert(column <= UINT16_MAX);
120  Column = column;
121  }
122 
123  /// \brief Set the Flags of this MCDwarfLoc.
124  void setFlags(unsigned flags) {
125  assert(flags <= UINT8_MAX);
126  Flags = flags;
127  }
128 
129  /// \brief Set the Isa of this MCDwarfLoc.
130  void setIsa(unsigned isa) {
131  assert(isa <= UINT8_MAX);
132  Isa = isa;
133  }
134 
135  /// \brief Set the Discriminator of this MCDwarfLoc.
136  void setDiscriminator(unsigned discriminator) {
137  Discriminator = discriminator;
138  }
139 };
140 
141 /// \brief Instances of this class represent the line information for
142 /// the dwarf line table entries. Which is created after a machine
143 /// instruction is assembled and uses an address from a temporary label
144 /// created at the current address in the current section and the info from
145 /// the last .loc directive seen as stored in the context.
146 class MCDwarfLineEntry : public MCDwarfLoc {
147  MCSymbol *Label;
148 
149 private:
150  // Allow the default copy constructor and assignment operator to be used
151  // for an MCDwarfLineEntry object.
152 
153 public:
154  // Constructor to create an MCDwarfLineEntry given a symbol and the dwarf loc.
156  : MCDwarfLoc(loc), Label(label) {}
157 
158  MCSymbol *getLabel() const { return Label; }
159 
160  // This is called when an instruction is assembled into the specified
161  // section and if there is information from the last .loc directive that
162  // has yet to have a line entry made for it is made.
163  static void Make(MCObjectStreamer *MCOS, MCSection *Section);
164 };
165 
166 /// \brief Instances of this class represent the line information for a compile
167 /// unit where machine instructions have been assembled after seeing .loc
168 /// directives. This is the information used to build the dwarf line
169 /// table for a section.
171 public:
172  // \brief Add an entry to this MCLineSection's line entries.
173  void addLineEntry(const MCDwarfLineEntry &LineEntry, MCSection *Sec) {
174  MCLineDivisions[Sec].push_back(LineEntry);
175  }
176 
177  using MCDwarfLineEntryCollection = std::vector<MCDwarfLineEntry>;
178  using iterator = MCDwarfLineEntryCollection::iterator;
179  using const_iterator = MCDwarfLineEntryCollection::const_iterator;
181 
182 private:
183  // A collection of MCDwarfLineEntry for each section.
184  MCLineDivisionMap MCLineDivisions;
185 
186 public:
187  // Returns the collection of MCDwarfLineEntry for a given Compile Unit ID.
189  return MCLineDivisions;
190  }
191 };
192 
194  /// First special line opcode - leave room for the standard opcodes.
195  /// Note: If you want to change this, you'll have to update the
196  /// "StandardOpcodeLengths" table that is emitted in
197  /// \c Emit().
198  uint8_t DWARF2LineOpcodeBase = 13;
199  /// Minimum line offset in a special line info. opcode. The value
200  /// -5 was chosen to give a reasonable range of values.
201  int8_t DWARF2LineBase = -5;
202  /// Range of line offsets in a special line info. opcode.
203  uint8_t DWARF2LineRange = 14;
204 };
205 
207  MCSymbol *Label = nullptr;
212  bool HasMD5 = false;
213 
214  MCDwarfLineTableHeader() = default;
215 
216  unsigned getFile(StringRef &Directory, StringRef &FileName,
217  MD5::MD5Result *Checksum, unsigned FileNumber = 0);
218  std::pair<MCSymbol *, MCSymbol *>
219  Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params,
220  Optional<MCDwarfLineStr> &LineStr) const;
221  std::pair<MCSymbol *, MCSymbol *>
222  Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params,
223  ArrayRef<char> SpecialOpcodeLengths,
224  Optional<MCDwarfLineStr> &LineStr) const;
225 
226 private:
227  void emitV2FileDirTables(MCStreamer *MCOS) const;
228  void emitV5FileDirTables(MCStreamer *MCOS,
229  Optional<MCDwarfLineStr> &LineStr) const;
230 };
231 
233  MCDwarfLineTableHeader Header;
234 
235 public:
236  void setCompilationDir(StringRef CompilationDir) {
237  Header.CompilationDir = CompilationDir;
238  }
239 
240  unsigned getFile(StringRef Directory, StringRef FileName,
242  return Header.getFile(Directory, FileName, Checksum);
243  }
244 
245  void Emit(MCStreamer &MCOS, MCDwarfLineTableParams Params) const;
246 };
247 
249  MCDwarfLineTableHeader Header;
250  MCLineSection MCLineSections;
251 
252 public:
253  // This emits the Dwarf file and the line tables for all Compile Units.
254  static void Emit(MCObjectStreamer *MCOS, MCDwarfLineTableParams Params);
255 
256  // This emits the Dwarf file and the line tables for a given Compile Unit.
257  void EmitCU(MCObjectStreamer *MCOS, MCDwarfLineTableParams Params,
258  Optional<MCDwarfLineStr> &LineStr) const;
259 
260  unsigned getFile(StringRef &Directory, StringRef &FileName,
261  MD5::MD5Result *Checksum, unsigned FileNumber = 0);
262 
263  MCSymbol *getLabel() const {
264  return Header.Label;
265  }
266 
267  void setLabel(MCSymbol *Label) {
268  Header.Label = Label;
269  }
270 
271  void setCompilationDir(StringRef CompilationDir) {
272  Header.CompilationDir = CompilationDir;
273  }
274 
276  return Header.MCDwarfDirs;
277  }
278 
280  return Header.MCDwarfDirs;
281  }
282 
284  return Header.MCDwarfFiles;
285  }
286 
288  return Header.MCDwarfFiles;
289  }
290 
292  return MCLineSections;
293  }
295  return MCLineSections;
296  }
297 };
298 
300 public:
301  /// Utility function to encode a Dwarf pair of LineDelta and AddrDeltas.
302  static void Encode(MCContext &Context, MCDwarfLineTableParams Params,
303  int64_t LineDelta, uint64_t AddrDelta, raw_ostream &OS);
304 
305  /// Utility function to emit the encoding to a streamer.
306  static void Emit(MCStreamer *MCOS, MCDwarfLineTableParams Params,
307  int64_t LineDelta, uint64_t AddrDelta);
308 };
309 
311 public:
312  //
313  // When generating dwarf for assembly source files this emits the Dwarf
314  // sections.
315  //
316  static void Emit(MCStreamer *MCOS);
317 };
318 
319 // When generating dwarf for assembly source files this is the info that is
320 // needed to be gathered for each symbol that will have a dwarf label.
322 private:
323  // Name of the symbol without a leading underbar, if any.
324  StringRef Name;
325  // The dwarf file number this symbol is in.
326  unsigned FileNumber;
327  // The line number this symbol is at.
328  unsigned LineNumber;
329  // The low_pc for the dwarf label is taken from this symbol.
330  MCSymbol *Label;
331 
332 public:
333  MCGenDwarfLabelEntry(StringRef name, unsigned fileNumber, unsigned lineNumber,
334  MCSymbol *label)
335  : Name(name), FileNumber(fileNumber), LineNumber(lineNumber),
336  Label(label) {}
337 
338  StringRef getName() const { return Name; }
339  unsigned getFileNumber() const { return FileNumber; }
340  unsigned getLineNumber() const { return LineNumber; }
341  MCSymbol *getLabel() const { return Label; }
342 
343  // This is called when label is created when we are generating dwarf for
344  // assembly source files.
345  static void Make(MCSymbol *Symbol, MCStreamer *MCOS, SourceMgr &SrcMgr,
346  SMLoc &Loc);
347 };
348 
350 public:
351  enum OpType {
366  OpGnuArgsSize
367  };
368 
369 private:
371  MCSymbol *Label;
372  unsigned Register;
373  union {
374  int Offset;
375  unsigned Register2;
376  };
377  std::vector<char> Values;
378 
379  MCCFIInstruction(OpType Op, MCSymbol *L, unsigned R, int O, StringRef V)
380  : Operation(Op), Label(L), Register(R), Offset(O),
381  Values(V.begin(), V.end()) {
382  assert(Op != OpRegister);
383  }
384 
385  MCCFIInstruction(OpType Op, MCSymbol *L, unsigned R1, unsigned R2)
386  : Operation(Op), Label(L), Register(R1), Register2(R2) {
387  assert(Op == OpRegister);
388  }
389 
390 public:
391  /// \brief .cfi_def_cfa defines a rule for computing CFA as: take address from
392  /// Register and add Offset to it.
393  static MCCFIInstruction createDefCfa(MCSymbol *L, unsigned Register,
394  int Offset) {
395  return MCCFIInstruction(OpDefCfa, L, Register, -Offset, "");
396  }
397 
398  /// \brief .cfi_def_cfa_register modifies a rule for computing CFA. From now
399  /// on Register will be used instead of the old one. Offset remains the same.
400  static MCCFIInstruction createDefCfaRegister(MCSymbol *L, unsigned Register) {
401  return MCCFIInstruction(OpDefCfaRegister, L, Register, 0, "");
402  }
403 
404  /// \brief .cfi_def_cfa_offset modifies a rule for computing CFA. Register
405  /// remains the same, but offset is new. Note that it is the absolute offset
406  /// that will be added to a defined register to the compute CFA address.
408  return MCCFIInstruction(OpDefCfaOffset, L, 0, -Offset, "");
409  }
410 
411  /// \brief .cfi_adjust_cfa_offset Same as .cfi_def_cfa_offset, but
412  /// Offset is a relative value that is added/subtracted from the previous
413  /// offset.
414  static MCCFIInstruction createAdjustCfaOffset(MCSymbol *L, int Adjustment) {
415  return MCCFIInstruction(OpAdjustCfaOffset, L, 0, Adjustment, "");
416  }
417 
418  /// \brief .cfi_offset Previous value of Register is saved at offset Offset
419  /// from CFA.
420  static MCCFIInstruction createOffset(MCSymbol *L, unsigned Register,
421  int Offset) {
422  return MCCFIInstruction(OpOffset, L, Register, Offset, "");
423  }
424 
425  /// \brief .cfi_rel_offset Previous value of Register is saved at offset
426  /// Offset from the current CFA register. This is transformed to .cfi_offset
427  /// using the known displacement of the CFA register from the CFA.
428  static MCCFIInstruction createRelOffset(MCSymbol *L, unsigned Register,
429  int Offset) {
430  return MCCFIInstruction(OpRelOffset, L, Register, Offset, "");
431  }
432 
433  /// \brief .cfi_register Previous value of Register1 is saved in
434  /// register Register2.
435  static MCCFIInstruction createRegister(MCSymbol *L, unsigned Register1,
436  unsigned Register2) {
437  return MCCFIInstruction(OpRegister, L, Register1, Register2);
438  }
439 
440  /// \brief .cfi_window_save SPARC register window is saved.
442  return MCCFIInstruction(OpWindowSave, L, 0, 0, "");
443  }
444 
445  /// \brief .cfi_restore says that the rule for Register is now the same as it
446  /// was at the beginning of the function, after all initial instructions added
447  /// by .cfi_startproc were executed.
448  static MCCFIInstruction createRestore(MCSymbol *L, unsigned Register) {
449  return MCCFIInstruction(OpRestore, L, Register, 0, "");
450  }
451 
452  /// \brief .cfi_undefined From now on the previous value of Register can't be
453  /// restored anymore.
454  static MCCFIInstruction createUndefined(MCSymbol *L, unsigned Register) {
455  return MCCFIInstruction(OpUndefined, L, Register, 0, "");
456  }
457 
458  /// \brief .cfi_same_value Current value of Register is the same as in the
459  /// previous frame. I.e., no restoration is needed.
460  static MCCFIInstruction createSameValue(MCSymbol *L, unsigned Register) {
461  return MCCFIInstruction(OpSameValue, L, Register, 0, "");
462  }
463 
464  /// \brief .cfi_remember_state Save all current rules for all registers.
466  return MCCFIInstruction(OpRememberState, L, 0, 0, "");
467  }
468 
469  /// \brief .cfi_restore_state Restore the previously saved state.
471  return MCCFIInstruction(OpRestoreState, L, 0, 0, "");
472  }
473 
474  /// \brief .cfi_escape Allows the user to add arbitrary bytes to the unwind
475  /// info.
477  return MCCFIInstruction(OpEscape, L, 0, 0, Vals);
478  }
479 
480  /// \brief A special wrapper for .cfi_escape that indicates GNU_ARGS_SIZE
482  return MCCFIInstruction(OpGnuArgsSize, L, 0, Size, "");
483  }
484 
485  OpType getOperation() const { return Operation; }
486  MCSymbol *getLabel() const { return Label; }
487 
488  unsigned getRegister() const {
489  assert(Operation == OpDefCfa || Operation == OpOffset ||
490  Operation == OpRestore || Operation == OpUndefined ||
491  Operation == OpSameValue || Operation == OpDefCfaRegister ||
492  Operation == OpRelOffset || Operation == OpRegister);
493  return Register;
494  }
495 
496  unsigned getRegister2() const {
497  assert(Operation == OpRegister);
498  return Register2;
499  }
500 
501  int getOffset() const {
502  assert(Operation == OpDefCfa || Operation == OpOffset ||
503  Operation == OpRelOffset || Operation == OpDefCfaOffset ||
504  Operation == OpAdjustCfaOffset || Operation == OpGnuArgsSize);
505  return Offset;
506  }
507 
509  assert(Operation == OpEscape);
510  return StringRef(&Values[0], Values.size());
511  }
512 };
513 
515  MCDwarfFrameInfo() = default;
516 
517  MCSymbol *Begin = nullptr;
518  MCSymbol *End = nullptr;
519  const MCSymbol *Personality = nullptr;
520  const MCSymbol *Lsda = nullptr;
521  std::vector<MCCFIInstruction> Instructions;
522  unsigned CurrentCfaRegister = 0;
523  unsigned PersonalityEncoding = 0;
524  unsigned LsdaEncoding = 0;
525  uint32_t CompactUnwindEncoding = 0;
526  bool IsSignalFrame = false;
527  bool IsSimple = false;
528  unsigned RAReg = static_cast<unsigned>(INT_MAX);
529 };
530 
532 public:
533  //
534  // This emits the frame info section.
535  //
536  static void Emit(MCObjectStreamer &streamer, MCAsmBackend *MAB, bool isEH);
537  static void EmitAdvanceLoc(MCObjectStreamer &Streamer, uint64_t AddrDelta);
538  static void EncodeAdvanceLoc(MCContext &Context, uint64_t AddrDelta,
539  raw_ostream &OS);
540 };
541 
542 } // end namespace llvm
543 
544 #endif // LLVM_MC_MCDWARF_H
void setCompilationDir(StringRef CompilationDir)
Definition: MCDwarf.h:271
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:39
const_iterator end(StringRef path)
Get end iterator over path.
Definition: Path.cpp:245
unsigned getLine() const
Get the Line of this MCDwarfLoc.
Definition: MCDwarf.h:97
LLVMContext & Context
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
Definition: Path.cpp:236
MCDwarfLineEntryCollection::iterator iterator
Definition: MCDwarf.h:178
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
SmallVectorImpl< std::string > & getMCDwarfDirs()
Definition: MCDwarf.h:279
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:42
static MCCFIInstruction createRememberState(MCSymbol *L)
.cfi_remember_state Save all current rules for all registers.
Definition: MCDwarf.h:465
SourceMgr SrcMgr
Definition: Error.cpp:23
static MCCFIInstruction createOffset(MCSymbol *L, unsigned Register, int Offset)
.cfi_offset Previous value of Register is saved at offset Offset from CFA.
Definition: MCDwarf.h:420
const SmallVectorImpl< std::string > & getMCDwarfDirs() const
Definition: MCDwarf.h:275
unsigned getFlags() const
Get the Flags of this MCDwarfLoc.
Definition: MCDwarf.h:103
SmallVectorImpl< MCDwarfFile > & getMCDwarfFiles()
Definition: MCDwarf.h:287
#define R2(n)
void setIsa(unsigned isa)
Set the Isa of this MCDwarfLoc.
Definition: MCDwarf.h:130
static MCCFIInstruction createDefCfaOffset(MCSymbol *L, int Offset)
.cfi_def_cfa_offset modifies a rule for computing CFA.
Definition: MCDwarf.h:407
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...
Definition: MCDwarf.h:414
std::vector< MCDwarfLineEntry > MCDwarfLineEntryCollection
Definition: MCDwarf.h:177
MCDwarfLineEntry(MCSymbol *label, const MCDwarfLoc loc)
Definition: MCDwarf.h:155
std::vector< MCCFIInstruction > Instructions
Definition: MCDwarf.h:521
static MCCFIInstruction createUndefined(MCSymbol *L, unsigned Register)
.cfi_undefined From now on the previous value of Register can&#39;t be restored anymore.
Definition: MCDwarf.h:454
std::string Name
Definition: MCDwarf.h:51
StringRef getName() const
Definition: MCDwarf.h:338
const MCLineDivisionMap & getMCLineEntries() const
Definition: MCDwarf.h:188
Context object for machine code objects.
Definition: MCContext.h:61
void setLine(unsigned line)
Set the Line of this MCDwarfLoc.
Definition: MCDwarf.h:115
Streaming object file generation interface.
unsigned getFile(StringRef &Directory, StringRef &FileName, MD5::MD5Result *Checksum, unsigned FileNumber=0)
Definition: MCDwarf.cpp:506
Instances of this class represent the information from a dwarf .loc directive.
Definition: MCDwarf.h:63
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:33
unsigned getFileNumber() const
Definition: MCDwarf.h:339
MCSymbol * getLabel() const
Definition: MCDwarf.h:486
unsigned getFileNum() const
Get the FileNum of this MCDwarfLoc.
Definition: MCDwarf.h:94
unsigned getFile(StringRef Directory, StringRef FileName, MD5::MD5Result *Checksum)
Definition: MCDwarf.h:240
static MCCFIInstruction createSameValue(MCSymbol *L, unsigned Register)
.cfi_same_value Current value of Register is the same as in the previous frame.
Definition: MCDwarf.h:460
const SmallVectorImpl< MCDwarfFile > & getMCDwarfFiles() const
Definition: MCDwarf.h:283
Streaming machine code generation interface.
Definition: MCStreamer.h:181
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...
Definition: MCDwarf.h:393
unsigned getRegister2() const
Definition: MCDwarf.h:496
static MCCFIInstruction createDefCfaRegister(MCSymbol *L, unsigned Register)
.cfi_def_cfa_register modifies a rule for computing CFA.
Definition: MCDwarf.h:400
PowerPC Reduce CR logical Operation
Instances of this class represent the line information for a compile unit where machine instructions ...
Definition: MCDwarf.h:170
static MCCFIInstruction createWindowSave(MCSymbol *L)
.cfi_window_save SPARC register window is saved.
Definition: MCDwarf.h:441
void addLineEntry(const MCDwarfLineEntry &LineEntry, MCSection *Sec)
Definition: MCDwarf.h:173
static MCCFIInstruction createGnuArgsSize(MCSymbol *L, int Size)
A special wrapper for .cfi_escape that indicates GNU_ARGS_SIZE.
Definition: MCDwarf.h:481
int getOffset() const
Definition: MCDwarf.h:501
OpType getOperation() const
Definition: MCDwarf.h:485
void setCompilationDir(StringRef CompilationDir)
Definition: MCDwarf.h:236
static const unsigned End
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...
Definition: MCDwarf.h:428
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...
Definition: MCDwarf.h:448
unsigned getDiscriminator() const
Get the Discriminator of this MCDwarfLoc.
Definition: MCDwarf.h:109
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling...
Definition: SourceMgr.h:41
StringRef getValues() const
Definition: MCDwarf.h:508
const MCLineSection & getMCLineSections() const
Definition: MCDwarf.h:291
static MCCFIInstruction createRestoreState(MCSymbol *L)
.cfi_restore_state Restore the previously saved state.
Definition: MCDwarf.h:470
unsigned getIsa() const
Get the Isa of this MCDwarfLoc.
Definition: MCDwarf.h:106
unsigned getRegister() const
Definition: MCDwarf.h:488
MCDwarfLineEntryCollection::const_iterator const_iterator
Definition: MCDwarf.h:179
Promote Memory to Register
Definition: Mem2Reg.cpp:110
LLVM_NODISCARD bool isa(const Y &Val)
Definition: Casting.h:142
Instances of this class represent the line information for the dwarf line table entries.
Definition: MCDwarf.h:146
MCLineSection & getMCLineSections()
Definition: MCDwarf.h:294
MCSymbol * getLabel() const
Definition: MCDwarf.h:158
MCSymbol * getLabel() const
Definition: MCDwarf.h:341
StringMap< unsigned > SourceIdMap
Definition: MCDwarf.h:210
unsigned getColumn() const
Get the Column of this MCDwarfLoc.
Definition: MCDwarf.h:100
void setFileNum(unsigned fileNum)
Set the FileNum of this MCDwarfLoc.
Definition: MCDwarf.h:112
void setFlags(unsigned flags)
Set the Flags of this MCDwarfLoc.
Definition: MCDwarf.h:124
MD5::MD5Result * Checksum
The MD5 checksum, if there is one.
Definition: MCDwarf.h:58
unsigned DirIndex
Definition: MCDwarf.h:54
MCSymbol * getLabel() const
Definition: MCDwarf.h:263
MCGenDwarfLabelEntry(StringRef name, unsigned fileNumber, unsigned lineNumber, MCSymbol *label)
Definition: MCDwarf.h:333
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:40
static const char * name
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:44
SmallVector< MCDwarfFile, 3 > MCDwarfFiles
Definition: MCDwarf.h:209
void setColumn(unsigned column)
Set the Column of this MCDwarfLoc.
Definition: MCDwarf.h:118
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
Instances of this class represent the name of the dwarf .file directive and its associated dwarf file...
Definition: MCDwarf.h:48
Represents a location in source code.
Definition: SMLoc.h:24
static MCCFIInstruction createEscape(MCSymbol *L, StringRef Vals)
.cfi_escape Allows the user to add arbitrary bytes to the unwind info.
Definition: MCDwarf.h:476
unsigned getLineNumber() const
Definition: MCDwarf.h:340
SmallVector< std::string, 3 > MCDwarfDirs
Definition: MCDwarf.h:208
void setDiscriminator(unsigned discriminator)
Set the Discriminator of this MCDwarfLoc.
Definition: MCDwarf.h:136
void setLabel(MCSymbol *Label)
Definition: MCDwarf.h:267
static MCCFIInstruction createRegister(MCSymbol *L, unsigned Register1, unsigned Register2)
.cfi_register Previous value of Register1 is saved in register Register2.
Definition: MCDwarf.h:435