LLVM  15.0.0git
MCFragment.h
Go to the documentation of this file.
1 //===- MCFragment.h - Fragment type hierarchy -------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_MC_MCFRAGMENT_H
10 #define LLVM_MC_MCFRAGMENT_H
11 
12 #include "llvm/ADT/ArrayRef.h"
13 #include "llvm/ADT/SmallString.h"
14 #include "llvm/ADT/SmallVector.h"
15 #include "llvm/ADT/StringRef.h"
16 #include "llvm/ADT/ilist_node.h"
17 #include "llvm/MC/MCFixup.h"
18 #include "llvm/MC/MCInst.h"
19 #include "llvm/Support/Alignment.h"
20 #include "llvm/Support/SMLoc.h"
21 #include <cstdint>
22 #include <utility>
23 
24 namespace llvm {
25 
26 class MCSection;
27 class MCSubtargetInfo;
28 class MCSymbol;
29 
30 class MCFragment : public ilist_node_with_parent<MCFragment, MCSection> {
31  friend class MCAsmLayout;
32 
33 public:
34  enum FragmentType : uint8_t {
51  };
52 
53 private:
54  /// The data for the section this fragment is in.
55  MCSection *Parent;
56 
57  /// The atom this fragment is in, as represented by its defining symbol.
58  const MCSymbol *Atom;
59 
60  /// The offset of this fragment in its section. This is ~0 until
61  /// initialized.
63 
64  /// The layout order of this fragment.
65  unsigned LayoutOrder;
66 
67  /// The subsection this fragment belongs to. This is 0 if the fragment is not
68  // in any subsection.
69  unsigned SubsectionNumber = 0;
70 
72 
73  /// Whether fragment is being laid out.
74  bool IsBeingLaidOut;
75 
76 protected:
78 
80  MCSection *Parent = nullptr);
81 
82 public:
83  MCFragment() = delete;
84  MCFragment(const MCFragment &) = delete;
85  MCFragment &operator=(const MCFragment &) = delete;
86 
87  /// Destroys the current fragment.
88  ///
89  /// This must be used instead of delete as MCFragment is non-virtual.
90  /// This method will dispatch to the appropriate subclass.
91  void destroy();
92 
93  FragmentType getKind() const { return Kind; }
94 
95  MCSection *getParent() const { return Parent; }
96  void setParent(MCSection *Value) { Parent = Value; }
97 
98  const MCSymbol *getAtom() const { return Atom; }
99  void setAtom(const MCSymbol *Value) { Atom = Value; }
100 
101  unsigned getLayoutOrder() const { return LayoutOrder; }
102  void setLayoutOrder(unsigned Value) { LayoutOrder = Value; }
103 
104  /// Does this fragment have instructions emitted into it? By default
105  /// this is false, but specific fragment types may set it to true.
106  bool hasInstructions() const { return HasInstructions; }
107 
108  void dump() const;
109 
110  void setSubsectionNumber(unsigned Value) { SubsectionNumber = Value; }
111  unsigned getSubsectionNumber() const { return SubsectionNumber; }
112 };
113 
114 class MCDummyFragment : public MCFragment {
115 public:
116  explicit MCDummyFragment(MCSection *Sec) : MCFragment(FT_Dummy, false, Sec) {}
117 
118  static bool classof(const MCFragment *F) { return F->getKind() == FT_Dummy; }
119 };
120 
121 /// Interface implemented by fragments that contain encoded instructions and/or
122 /// data.
123 ///
125  /// Should this fragment be aligned to the end of a bundle?
126  bool AlignToBundleEnd = false;
127 
128  uint8_t BundlePadding = 0;
129 
130 protected:
132  MCSection *Sec)
133  : MCFragment(FType, HasInstructions, Sec) {}
134 
135  /// The MCSubtargetInfo in effect when the instruction was encoded.
136  /// It must be non-null for instructions.
137  const MCSubtargetInfo *STI = nullptr;
138 
139 public:
140  static bool classof(const MCFragment *F) {
141  MCFragment::FragmentType Kind = F->getKind();
142  switch (Kind) {
143  default:
144  return false;
147  case MCFragment::FT_Data:
151  return true;
152  }
153  }
154 
155  /// Should this fragment be placed at the end of an aligned bundle?
156  bool alignToBundleEnd() const { return AlignToBundleEnd; }
157  void setAlignToBundleEnd(bool V) { AlignToBundleEnd = V; }
158 
159  /// Get the padding size that must be inserted before this fragment.
160  /// Used for bundling. By default, no padding is inserted.
161  /// Note that padding size is restricted to 8 bits. This is an optimization
162  /// to reduce the amount of space used for each fragment. In practice, larger
163  /// padding should never be required.
164  uint8_t getBundlePadding() const { return BundlePadding; }
165 
166  /// Set the padding size for this fragment. By default it's a no-op,
167  /// and only some fragments have a meaningful implementation.
168  void setBundlePadding(uint8_t N) { BundlePadding = N; }
169 
170  /// Retrieve the MCSubTargetInfo in effect when the instruction was encoded.
171  /// Guaranteed to be non-null if hasInstructions() == true
172  const MCSubtargetInfo *getSubtargetInfo() const { return STI; }
173 
174  /// Record that the fragment contains instructions with the MCSubtargetInfo in
175  /// effect when the instruction was encoded.
177  HasInstructions = true;
178  this->STI = &STI;
179  }
180 };
181 
182 /// Interface implemented by fragments that contain encoded instructions and/or
183 /// data.
184 ///
185 template<unsigned ContentsSize>
188 
189 protected:
191  bool HasInstructions,
192  MCSection *Sec)
193  : MCEncodedFragment(FType, HasInstructions, Sec) {}
194 
195 public:
196  SmallVectorImpl<char> &getContents() { return Contents; }
197  const SmallVectorImpl<char> &getContents() const { return Contents; }
198 };
199 
200 /// Interface implemented by fragments that contain encoded instructions and/or
201 /// data and also have fixups registered.
202 ///
203 template<unsigned ContentsSize, unsigned FixupsSize>
205  public MCEncodedFragmentWithContents<ContentsSize> {
206 
207  /// The list of fixups in this fragment.
209 
210 protected:
212  bool HasInstructions,
213  MCSection *Sec)
214  : MCEncodedFragmentWithContents<ContentsSize>(FType, HasInstructions,
215  Sec) {}
216 
217 public:
218 
221 
222  SmallVectorImpl<MCFixup> &getFixups() { return Fixups; }
223  const SmallVectorImpl<MCFixup> &getFixups() const { return Fixups; }
224 
225  fixup_iterator fixup_begin() { return Fixups.begin(); }
226  const_fixup_iterator fixup_begin() const { return Fixups.begin(); }
227 
228  fixup_iterator fixup_end() { return Fixups.end(); }
229  const_fixup_iterator fixup_end() const { return Fixups.end(); }
230 
231  static bool classof(const MCFragment *F) {
232  MCFragment::FragmentType Kind = F->getKind();
233  return Kind == MCFragment::FT_Relaxable || Kind == MCFragment::FT_Data ||
234  Kind == MCFragment::FT_CVDefRange || Kind == MCFragment::FT_Dwarf ||
236  }
237 };
238 
239 /// Fragment for data and encoded instructions.
240 ///
242 public:
243  MCDataFragment(MCSection *Sec = nullptr)
244  : MCEncodedFragmentWithFixups<32, 4>(FT_Data, false, Sec) {}
245 
246  static bool classof(const MCFragment *F) {
247  return F->getKind() == MCFragment::FT_Data;
248  }
249 };
250 
251 /// This is a compact (memory-size-wise) fragment for holding an encoded
252 /// instruction (non-relaxable) that has no fixups registered. When applicable,
253 /// it can be used instead of MCDataFragment and lead to lower memory
254 /// consumption.
255 ///
257 public:
260  }
261 
262  static bool classof(const MCFragment *F) {
263  return F->getKind() == MCFragment::FT_CompactEncodedInst;
264  }
265 };
266 
267 /// A relaxable fragment holds on to its MCInst, since it may need to be
268 /// relaxed during the assembler layout and relaxation stage.
269 ///
271 
272  /// The instruction this is a fragment for.
273  MCInst Inst;
274  /// Can we auto pad the instruction?
275  bool AllowAutoPadding = false;
276 
277 public:
279  MCSection *Sec = nullptr)
281  Inst(Inst) { this->STI = &STI; }
282 
283  const MCInst &getInst() const { return Inst; }
284  void setInst(const MCInst &Value) { Inst = Value; }
285 
286  bool getAllowAutoPadding() const { return AllowAutoPadding; }
287  void setAllowAutoPadding(bool V) { AllowAutoPadding = V; }
288 
289  static bool classof(const MCFragment *F) {
290  return F->getKind() == MCFragment::FT_Relaxable;
291  }
292 };
293 
294 class MCAlignFragment : public MCFragment {
295  /// The alignment to ensure, in bytes.
296  unsigned Alignment;
297 
298  /// Flag to indicate that (optimal) NOPs should be emitted instead
299  /// of using the provided value. The exact interpretation of this flag is
300  /// target dependent.
301  bool EmitNops : 1;
302 
303  /// Value to use for filling padding bytes.
304  int64_t Value;
305 
306  /// The size of the integer (in bytes) of \p Value.
307  unsigned ValueSize;
308 
309  /// The maximum number of bytes to emit; if the alignment
310  /// cannot be satisfied in this width then this fragment is ignored.
311  unsigned MaxBytesToEmit;
312 
313  /// When emitting Nops some subtargets have specific nop encodings.
314  const MCSubtargetInfo *STI;
315 
316 public:
317  MCAlignFragment(unsigned Alignment, int64_t Value, unsigned ValueSize,
318  unsigned MaxBytesToEmit, MCSection *Sec = nullptr)
319  : MCFragment(FT_Align, false, Sec), Alignment(Alignment), EmitNops(false),
320  Value(Value), ValueSize(ValueSize), MaxBytesToEmit(MaxBytesToEmit) {}
321 
322  unsigned getAlignment() const { return Alignment; }
323 
324  int64_t getValue() const { return Value; }
325 
326  unsigned getValueSize() const { return ValueSize; }
327 
328  unsigned getMaxBytesToEmit() const { return MaxBytesToEmit; }
329 
330  bool hasEmitNops() const { return EmitNops; }
331  void setEmitNops(bool Value, const MCSubtargetInfo *STI) {
332  EmitNops = Value;
333  this->STI = STI;
334  }
335 
336  const MCSubtargetInfo *getSubtargetInfo() const { return STI; }
337 
338  static bool classof(const MCFragment *F) {
339  return F->getKind() == MCFragment::FT_Align;
340  }
341 };
342 
343 class MCFillFragment : public MCFragment {
344  uint8_t ValueSize;
345  /// Value to use for filling bytes.
346  uint64_t Value;
347  /// The number of bytes to insert.
348  const MCExpr &NumValues;
349 
350  /// Source location of the directive that this fragment was created for.
351  SMLoc Loc;
352 
353 public:
354  MCFillFragment(uint64_t Value, uint8_t VSize, const MCExpr &NumValues,
355  SMLoc Loc, MCSection *Sec = nullptr)
356  : MCFragment(FT_Fill, false, Sec), ValueSize(VSize), Value(Value),
357  NumValues(NumValues), Loc(Loc) {}
358 
359  uint64_t getValue() const { return Value; }
360  uint8_t getValueSize() const { return ValueSize; }
361  const MCExpr &getNumValues() const { return NumValues; }
362 
363  SMLoc getLoc() const { return Loc; }
364 
365  static bool classof(const MCFragment *F) {
366  return F->getKind() == MCFragment::FT_Fill;
367  }
368 };
369 
370 class MCNopsFragment : public MCFragment {
371  /// The number of bytes to insert.
372  int64_t Size;
373  /// Maximum number of bytes allowed in each NOP instruction.
374  int64_t ControlledNopLength;
375 
376  /// Source location of the directive that this fragment was created for.
377  SMLoc Loc;
378 
379  /// When emitting Nops some subtargets have specific nop encodings.
380  const MCSubtargetInfo &STI;
381 
382 public:
383  MCNopsFragment(int64_t NumBytes, int64_t ControlledNopLength, SMLoc L,
384  const MCSubtargetInfo &STI, MCSection *Sec = nullptr)
385  : MCFragment(FT_Nops, false, Sec), Size(NumBytes),
386  ControlledNopLength(ControlledNopLength), Loc(L), STI(STI) {}
387 
388  int64_t getNumBytes() const { return Size; }
389  int64_t getControlledNopLength() const { return ControlledNopLength; }
390 
391  SMLoc getLoc() const { return Loc; }
392 
393  const MCSubtargetInfo *getSubtargetInfo() const { return &STI; }
394 
395  static bool classof(const MCFragment *F) {
396  return F->getKind() == MCFragment::FT_Nops;
397  }
398 };
399 
400 class MCOrgFragment : public MCFragment {
401  /// Value to use for filling bytes.
402  int8_t Value;
403 
404  /// The offset this fragment should start at.
405  const MCExpr *Offset;
406 
407  /// Source location of the directive that this fragment was created for.
408  SMLoc Loc;
409 
410 public:
411  MCOrgFragment(const MCExpr &Offset, int8_t Value, SMLoc Loc,
412  MCSection *Sec = nullptr)
413  : MCFragment(FT_Org, false, Sec), Value(Value), Offset(&Offset),
414  Loc(Loc) {}
415 
416  const MCExpr &getOffset() const { return *Offset; }
417 
418  uint8_t getValue() const { return Value; }
419 
420  SMLoc getLoc() const { return Loc; }
421 
422  static bool classof(const MCFragment *F) {
423  return F->getKind() == MCFragment::FT_Org;
424  }
425 };
426 
427 class MCLEBFragment : public MCFragment {
428  /// True if this is a sleb128, false if uleb128.
429  bool IsSigned;
430 
431  /// The value this fragment should contain.
432  const MCExpr *Value;
433 
434  SmallString<8> Contents;
435 
436 public:
437  MCLEBFragment(const MCExpr &Value_, bool IsSigned_, MCSection *Sec = nullptr)
438  : MCFragment(FT_LEB, false, Sec), IsSigned(IsSigned_), Value(&Value_) {
439  Contents.push_back(0);
440  }
441 
442  const MCExpr &getValue() const { return *Value; }
443 
444  bool isSigned() const { return IsSigned; }
445 
446  SmallString<8> &getContents() { return Contents; }
447  const SmallString<8> &getContents() const { return Contents; }
448 
449  /// @}
450 
451  static bool classof(const MCFragment *F) {
452  return F->getKind() == MCFragment::FT_LEB;
453  }
454 };
455 
457  /// The value of the difference between the two line numbers
458  /// between two .loc dwarf directives.
459  int64_t LineDelta;
460 
461  /// The expression for the difference of the two symbols that
462  /// make up the address delta between two .loc dwarf directives.
463  const MCExpr *AddrDelta;
464 
465 public:
466  MCDwarfLineAddrFragment(int64_t LineDelta, const MCExpr &AddrDelta,
467  MCSection *Sec = nullptr)
469  LineDelta(LineDelta), AddrDelta(&AddrDelta) {}
470 
471  int64_t getLineDelta() const { return LineDelta; }
472 
473  const MCExpr &getAddrDelta() const { return *AddrDelta; }
474 
475  static bool classof(const MCFragment *F) {
476  return F->getKind() == MCFragment::FT_Dwarf;
477  }
478 };
479 
481  /// The expression for the difference of the two symbols that
482  /// make up the address delta between two .cfi_* dwarf directives.
483  const MCExpr *AddrDelta;
484 
485 public:
486  MCDwarfCallFrameFragment(const MCExpr &AddrDelta, MCSection *Sec = nullptr)
488  AddrDelta(&AddrDelta) {}
489 
490  const MCExpr &getAddrDelta() const { return *AddrDelta; }
491 
492  static bool classof(const MCFragment *F) {
493  return F->getKind() == MCFragment::FT_DwarfFrame;
494  }
495 };
496 
497 /// Represents a symbol table index fragment.
499  const MCSymbol *Sym;
500 
501 public:
502  MCSymbolIdFragment(const MCSymbol *Sym, MCSection *Sec = nullptr)
503  : MCFragment(FT_SymbolId, false, Sec), Sym(Sym) {}
504 
505  const MCSymbol *getSymbol() { return Sym; }
506  const MCSymbol *getSymbol() const { return Sym; }
507 
508  static bool classof(const MCFragment *F) {
509  return F->getKind() == MCFragment::FT_SymbolId;
510  }
511 };
512 
513 /// Fragment representing the binary annotations produced by the
514 /// .cv_inline_linetable directive.
516  unsigned SiteFuncId;
517  unsigned StartFileId;
518  unsigned StartLineNum;
519  const MCSymbol *FnStartSym;
520  const MCSymbol *FnEndSym;
521  SmallString<8> Contents;
522 
523  /// CodeViewContext has the real knowledge about this format, so let it access
524  /// our members.
525  friend class CodeViewContext;
526 
527 public:
528  MCCVInlineLineTableFragment(unsigned SiteFuncId, unsigned StartFileId,
529  unsigned StartLineNum, const MCSymbol *FnStartSym,
530  const MCSymbol *FnEndSym,
531  MCSection *Sec = nullptr)
532  : MCFragment(FT_CVInlineLines, false, Sec), SiteFuncId(SiteFuncId),
533  StartFileId(StartFileId), StartLineNum(StartLineNum),
534  FnStartSym(FnStartSym), FnEndSym(FnEndSym) {}
535 
536  const MCSymbol *getFnStartSym() const { return FnStartSym; }
537  const MCSymbol *getFnEndSym() const { return FnEndSym; }
538 
539  SmallString<8> &getContents() { return Contents; }
540  const SmallString<8> &getContents() const { return Contents; }
541 
542  static bool classof(const MCFragment *F) {
543  return F->getKind() == MCFragment::FT_CVInlineLines;
544  }
545 };
546 
547 /// Fragment representing the .cv_def_range directive.
550  SmallString<32> FixedSizePortion;
551 
552  /// CodeViewContext has the real knowledge about this format, so let it access
553  /// our members.
554  friend class CodeViewContext;
555 
556 public:
558  ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
559  StringRef FixedSizePortion, MCSection *Sec = nullptr)
561  Ranges(Ranges.begin(), Ranges.end()),
562  FixedSizePortion(FixedSizePortion) {}
563 
565  return Ranges;
566  }
567 
568  StringRef getFixedSizePortion() const { return FixedSizePortion.str(); }
569 
570  static bool classof(const MCFragment *F) {
571  return F->getKind() == MCFragment::FT_CVDefRange;
572  }
573 };
574 
575 /// Represents required padding such that a particular other set of fragments
576 /// does not cross a particular power-of-two boundary. The other fragments must
577 /// follow this one within the same section.
579  /// The alignment requirement of the branch to be aligned.
580  Align AlignBoundary;
581  /// The last fragment in the set of fragments to be aligned.
582  const MCFragment *LastFragment = nullptr;
583  /// The size of the fragment. The size is lazily set during relaxation, and
584  /// is not meaningful before that.
585  uint64_t Size = 0;
586 
587  /// When emitting Nops some subtargets have specific nop encodings.
588  const MCSubtargetInfo &STI;
589 
590 public:
591  MCBoundaryAlignFragment(Align AlignBoundary, const MCSubtargetInfo &STI,
592  MCSection *Sec = nullptr)
593  : MCFragment(FT_BoundaryAlign, false, Sec), AlignBoundary(AlignBoundary),
594  STI(STI) {}
595 
596  uint64_t getSize() const { return Size; }
597  void setSize(uint64_t Value) { Size = Value; }
598 
599  Align getAlignment() const { return AlignBoundary; }
600  void setAlignment(Align Value) { AlignBoundary = Value; }
601 
602  const MCFragment *getLastFragment() const { return LastFragment; }
603  void setLastFragment(const MCFragment *F) {
604  assert(!F || getParent() == F->getParent());
605  LastFragment = F;
606  }
607 
608  const MCSubtargetInfo *getSubtargetInfo() const { return &STI; }
609 
610  static bool classof(const MCFragment *F) {
611  return F->getKind() == MCFragment::FT_BoundaryAlign;
612  }
613 };
614 
616  /// The expression for the difference of the two symbols that
617  /// make up the address delta between two .pseudoprobe directives.
618  const MCExpr *AddrDelta;
619 
620 public:
621  MCPseudoProbeAddrFragment(const MCExpr *AddrDelta, MCSection *Sec = nullptr)
623  AddrDelta(AddrDelta) {}
624 
625  const MCExpr &getAddrDelta() const { return *AddrDelta; }
626 
627  static bool classof(const MCFragment *F) {
628  return F->getKind() == MCFragment::FT_PseudoProbe;
629  }
630 };
631 } // end namespace llvm
632 
633 #endif // LLVM_MC_MCFRAGMENT_H
llvm::MCOrgFragment::MCOrgFragment
MCOrgFragment(const MCExpr &Offset, int8_t Value, SMLoc Loc, MCSection *Sec=nullptr)
Definition: MCFragment.h:411
llvm::MCFragment::FT_DwarfFrame
@ FT_DwarfFrame
Definition: MCFragment.h:43
llvm::MCBoundaryAlignFragment::setAlignment
void setAlignment(Align Value)
Definition: MCFragment.h:600
llvm::MCFragment::HasInstructions
bool HasInstructions
Definition: MCFragment.h:77
llvm::MCAlignFragment::hasEmitNops
bool hasEmitNops() const
Definition: MCFragment.h:330
llvm::MCFillFragment::classof
static bool classof(const MCFragment *F)
Definition: MCFragment.h:365
llvm::MCBoundaryAlignFragment::getSubtargetInfo
const MCSubtargetInfo * getSubtargetInfo() const
Definition: MCFragment.h:608
llvm::MCFragment::getSubsectionNumber
unsigned getSubsectionNumber() const
Definition: MCFragment.h:111
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::MCFragment::FT_BoundaryAlign
@ FT_BoundaryAlign
Definition: MCFragment.h:45
llvm::MCRelaxableFragment
A relaxable fragment holds on to its MCInst, since it may need to be relaxed during the assembler lay...
Definition: MCFragment.h:270
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::MCCVInlineLineTableFragment
Fragment representing the binary annotations produced by the .cv_inline_linetable directive.
Definition: MCFragment.h:515
llvm::MCEncodedFragment::setHasInstructions
void setHasInstructions(const MCSubtargetInfo &STI)
Record that the fragment contains instructions with the MCSubtargetInfo in effect when the instructio...
Definition: MCFragment.h:176
llvm::MCDataFragment::classof
static bool classof(const MCFragment *F)
Definition: MCFragment.h:246
llvm::MCFragment::operator=
MCFragment & operator=(const MCFragment &)=delete
llvm::MCDwarfCallFrameFragment
Definition: MCFragment.h:480
llvm::MCFragment::FT_CVInlineLines
@ FT_CVInlineLines
Definition: MCFragment.h:47
llvm::MCCVInlineLineTableFragment::getFnEndSym
const MCSymbol * getFnEndSym() const
Definition: MCFragment.h:537
StringRef.h
llvm::MCBoundaryAlignFragment::setSize
void setSize(uint64_t Value)
Definition: MCFragment.h:597
llvm::MCNopsFragment::classof
static bool classof(const MCFragment *F)
Definition: MCFragment.h:395
llvm::SmallVector< char, ContentsSize >
llvm::ilist_node_with_parent
An ilist node that can access its parent list.
Definition: ilist_node.h:257
llvm::MCNopsFragment::getLoc
SMLoc getLoc() const
Definition: MCFragment.h:391
llvm::MCDwarfLineAddrFragment::MCDwarfLineAddrFragment
MCDwarfLineAddrFragment(int64_t LineDelta, const MCExpr &AddrDelta, MCSection *Sec=nullptr)
Definition: MCFragment.h:466
llvm::MCCVDefRangeFragment::getRanges
ArrayRef< std::pair< const MCSymbol *, const MCSymbol * > > getRanges() const
Definition: MCFragment.h:564
llvm::MCDwarfLineAddrFragment::getLineDelta
int64_t getLineDelta() const
Definition: MCFragment.h:471
llvm::MCBoundaryAlignFragment::classof
static bool classof(const MCFragment *F)
Definition: MCFragment.h:610
llvm::MCAlignFragment::setEmitNops
void setEmitNops(bool Value, const MCSubtargetInfo *STI)
Definition: MCFragment.h:331
true
basic Basic Alias true
Definition: BasicAliasAnalysis.cpp:1909
llvm::MCNopsFragment
Definition: MCFragment.h:370
llvm::sys::path::end
const_iterator end(StringRef path)
Get end iterator over path.
Definition: Path.cpp:235
llvm::sys::path::begin
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
Definition: Path.cpp:226
llvm::MCDwarfLineAddrFragment::classof
static bool classof(const MCFragment *F)
Definition: MCFragment.h:475
llvm::MCFragment::getParent
MCSection * getParent() const
Definition: MCFragment.h:95
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:79
llvm::MCDummyFragment::classof
static bool classof(const MCFragment *F)
Definition: MCFragment.h:118
llvm::MCInst
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:184
llvm::MCEncodedFragmentWithFixups::getFixups
SmallVectorImpl< MCFixup > & getFixups()
Definition: MCFragment.h:222
llvm::MCEncodedFragmentWithFixups< 8, 1 >::const_fixup_iterator
SmallVectorImpl< MCFixup >::const_iterator const_fixup_iterator
Definition: MCFragment.h:219
llvm::MCFragment::FT_CVDefRange
@ FT_CVDefRange
Definition: MCFragment.h:48
llvm::MCCVInlineLineTableFragment::classof
static bool classof(const MCFragment *F)
Definition: MCFragment.h:542
llvm::MCEncodedFragment::alignToBundleEnd
bool alignToBundleEnd() const
Should this fragment be placed at the end of an aligned bundle?
Definition: MCFragment.h:156
F
#define F(x, y, z)
Definition: MD5.cpp:55
llvm::MCFragment::dump
void dump() const
Definition: MCFragment.cpp:339
llvm::MCAlignFragment::classof
static bool classof(const MCFragment *F)
Definition: MCFragment.h:338
llvm::MCLEBFragment::MCLEBFragment
MCLEBFragment(const MCExpr &Value_, bool IsSigned_, MCSection *Sec=nullptr)
Definition: MCFragment.h:437
llvm::MCRelaxableFragment::classof
static bool classof(const MCFragment *F)
Definition: MCFragment.h:289
llvm::MCAlignFragment::getMaxBytesToEmit
unsigned getMaxBytesToEmit() const
Definition: MCFragment.h:328
llvm::MCFragment
Definition: MCFragment.h:30
llvm::MCBoundaryAlignFragment::getAlignment
Align getAlignment() const
Definition: MCFragment.h:599
llvm::MCFillFragment::getLoc
SMLoc getLoc() const
Definition: MCFragment.h:363
llvm::MCDummyFragment
Definition: MCFragment.h:114
llvm::MCFragment::FragmentType
FragmentType
Definition: MCFragment.h:34
llvm::MCFragment::MCFragment
MCFragment()=delete
llvm::MCDwarfCallFrameFragment::MCDwarfCallFrameFragment
MCDwarfCallFrameFragment(const MCExpr &AddrDelta, MCSection *Sec=nullptr)
Definition: MCFragment.h:486
llvm::MCRelaxableFragment::setAllowAutoPadding
void setAllowAutoPadding(bool V)
Definition: MCFragment.h:287
llvm::SMLoc
Represents a location in source code.
Definition: SMLoc.h:23
llvm::MCEncodedFragmentWithFixups< 8, 1 >::fixup_iterator
SmallVectorImpl< MCFixup >::iterator fixup_iterator
Definition: MCFragment.h:220
llvm::MCSymbolIdFragment::MCSymbolIdFragment
MCSymbolIdFragment(const MCSymbol *Sym, MCSection *Sec=nullptr)
Definition: MCFragment.h:502
llvm::MCAlignFragment
Definition: MCFragment.h:294
SmallString.h
llvm::MCLEBFragment::getContents
SmallString< 8 > & getContents()
Definition: MCFragment.h:446
llvm::MCSymbolIdFragment
Represents a symbol table index fragment.
Definition: MCFragment.h:498
llvm::CodeViewContext
Holds state from .cv_file and .cv_loc directives for later emission.
Definition: MCCodeView.h:144
llvm::MCEncodedFragmentWithFixups::MCEncodedFragmentWithFixups
MCEncodedFragmentWithFixups(MCFragment::FragmentType FType, bool HasInstructions, MCSection *Sec)
Definition: MCFragment.h:211
llvm::MCPseudoProbeAddrFragment::classof
static bool classof(const MCFragment *F)
Definition: MCFragment.h:627
llvm::MCNopsFragment::MCNopsFragment
MCNopsFragment(int64_t NumBytes, int64_t ControlledNopLength, SMLoc L, const MCSubtargetInfo &STI, MCSection *Sec=nullptr)
Definition: MCFragment.h:383
llvm::MCPseudoProbeAddrFragment::MCPseudoProbeAddrFragment
MCPseudoProbeAddrFragment(const MCExpr *AddrDelta, MCSection *Sec=nullptr)
Definition: MCFragment.h:621
MCInst.h
false
Definition: StackSlotColoring.cpp:141
llvm::MCRelaxableFragment::setInst
void setInst(const MCInst &Value)
Definition: MCFragment.h:284
llvm::MCCVDefRangeFragment::MCCVDefRangeFragment
MCCVDefRangeFragment(ArrayRef< std::pair< const MCSymbol *, const MCSymbol * >> Ranges, StringRef FixedSizePortion, MCSection *Sec=nullptr)
Definition: MCFragment.h:557
SMLoc.h
llvm::MCRelaxableFragment::getInst
const MCInst & getInst() const
Definition: MCFragment.h:283
llvm::MCOrgFragment::getLoc
SMLoc getLoc() const
Definition: MCFragment.h:420
llvm::MCEncodedFragmentWithContents::getContents
const SmallVectorImpl< char > & getContents() const
Definition: MCFragment.h:197
llvm::Align
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition: Alignment.h:39
llvm::MCFragment::setAtom
void setAtom(const MCSymbol *Value)
Definition: MCFragment.h:99
llvm::MCFragment::hasInstructions
bool hasInstructions() const
Does this fragment have instructions emitted into it? By default this is false, but specific fragment...
Definition: MCFragment.h:106
llvm::lltok::Kind
Kind
Definition: LLToken.h:18
llvm::MCEncodedFragmentWithContents::MCEncodedFragmentWithContents
MCEncodedFragmentWithContents(MCFragment::FragmentType FType, bool HasInstructions, MCSection *Sec)
Definition: MCFragment.h:190
llvm::SmallString< 8 >
llvm::MCDwarfLineAddrFragment
Definition: MCFragment.h:456
llvm::MCLEBFragment::getContents
const SmallString< 8 > & getContents() const
Definition: MCFragment.h:447
llvm::MCDwarfLineAddrFragment::getAddrDelta
const MCExpr & getAddrDelta() const
Definition: MCFragment.h:473
llvm::MCFragment::FT_LEB
@ FT_LEB
Definition: MCFragment.h:44
llvm::MCRelaxableFragment::MCRelaxableFragment
MCRelaxableFragment(const MCInst &Inst, const MCSubtargetInfo &STI, MCSection *Sec=nullptr)
Definition: MCFragment.h:278
llvm::MCEncodedFragment
Interface implemented by fragments that contain encoded instructions and/or data.
Definition: MCFragment.h:124
llvm::MCAlignFragment::getValueSize
unsigned getValueSize() const
Definition: MCFragment.h:326
llvm::MCEncodedFragment::MCEncodedFragment
MCEncodedFragment(MCFragment::FragmentType FType, bool HasInstructions, MCSection *Sec)
Definition: MCFragment.h:131
uint64_t
llvm::MCCompactEncodedInstFragment
This is a compact (memory-size-wise) fragment for holding an encoded instruction (non-relaxable) that...
Definition: MCFragment.h:256
llvm::MCSymbolIdFragment::classof
static bool classof(const MCFragment *F)
Definition: MCFragment.h:508
llvm::MCPseudoProbeAddrFragment
Definition: MCFragment.h:615
llvm::MCFragment::FT_Org
@ FT_Org
Definition: MCFragment.h:41
llvm::MCCVInlineLineTableFragment::MCCVInlineLineTableFragment
MCCVInlineLineTableFragment(unsigned SiteFuncId, unsigned StartFileId, unsigned StartLineNum, const MCSymbol *FnStartSym, const MCSymbol *FnEndSym, MCSection *Sec=nullptr)
Definition: MCFragment.h:528
llvm::MCFragment::setSubsectionNumber
void setSubsectionNumber(unsigned Value)
Definition: MCFragment.h:110
llvm::MCEncodedFragment::setBundlePadding
void setBundlePadding(uint8_t N)
Set the padding size for this fragment.
Definition: MCFragment.h:168
llvm::MCCVDefRangeFragment::classof
static bool classof(const MCFragment *F)
Definition: MCFragment.h:570
llvm::MCBoundaryAlignFragment::getLastFragment
const MCFragment * getLastFragment() const
Definition: MCFragment.h:602
ArrayRef.h
llvm::SmallVectorImpl::const_iterator
typename SuperClass::const_iterator const_iterator
Definition: SmallVector.h:559
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::MCDwarfCallFrameFragment::classof
static bool classof(const MCFragment *F)
Definition: MCFragment.h:492
llvm::MCCVInlineLineTableFragment::getContents
const SmallString< 8 > & getContents() const
Definition: MCFragment.h:540
llvm::MCFillFragment
Definition: MCFragment.h:343
llvm::MCFragment::FT_SymbolId
@ FT_SymbolId
Definition: MCFragment.h:46
llvm::MCEncodedFragmentWithFixups::fixup_end
const_fixup_iterator fixup_end() const
Definition: MCFragment.h:229
llvm::MCFragment::FT_PseudoProbe
@ FT_PseudoProbe
Definition: MCFragment.h:49
llvm::MCFillFragment::getNumValues
const MCExpr & getNumValues() const
Definition: MCFragment.h:361
llvm::MCSymbolIdFragment::getSymbol
const MCSymbol * getSymbol() const
Definition: MCFragment.h:506
llvm::MCFragment::setLayoutOrder
void setLayoutOrder(unsigned Value)
Definition: MCFragment.h:102
llvm::MCPseudoProbeAddrFragment::getAddrDelta
const MCExpr & getAddrDelta() const
Definition: MCFragment.h:625
llvm::MCOrgFragment
Definition: MCFragment.h:400
llvm::MCBoundaryAlignFragment::MCBoundaryAlignFragment
MCBoundaryAlignFragment(Align AlignBoundary, const MCSubtargetInfo &STI, MCSection *Sec=nullptr)
Definition: MCFragment.h:591
llvm::MCFragment::FT_Align
@ FT_Align
Definition: MCFragment.h:35
llvm::MCFragment::getKind
FragmentType getKind() const
Definition: MCFragment.h:93
llvm::MCBoundaryAlignFragment::setLastFragment
void setLastFragment(const MCFragment *F)
Definition: MCFragment.h:603
llvm::MCDwarfCallFrameFragment::getAddrDelta
const MCExpr & getAddrDelta() const
Definition: MCFragment.h:490
llvm::MCCVDefRangeFragment::getFixedSizePortion
StringRef getFixedSizePortion() const
Definition: MCFragment.h:568
llvm::MCFillFragment::getValue
uint64_t getValue() const
Definition: MCFragment.h:359
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::MCDataFragment::MCDataFragment
MCDataFragment(MCSection *Sec=nullptr)
Definition: MCFragment.h:243
llvm::MCEncodedFragmentWithContents
Interface implemented by fragments that contain encoded instructions and/or data.
Definition: MCFragment.h:186
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::MCEncodedFragmentWithFixups::classof
static bool classof(const MCFragment *F)
Definition: MCFragment.h:231
llvm::MCCVInlineLineTableFragment::getFnStartSym
const MCSymbol * getFnStartSym() const
Definition: MCFragment.h:536
llvm::MCLEBFragment::getValue
const MCExpr & getValue() const
Definition: MCFragment.h:442
llvm::MCFragment::FT_Data
@ FT_Data
Definition: MCFragment.h:36
llvm::MCAlignFragment::getValue
int64_t getValue() const
Definition: MCFragment.h:324
MCFixup.h
llvm::MCBoundaryAlignFragment::getSize
uint64_t getSize() const
Definition: MCFragment.h:596
llvm::MCSection
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition: MCSection.h:39
llvm::MCSymbolIdFragment::getSymbol
const MCSymbol * getSymbol()
Definition: MCFragment.h:505
llvm::MCAlignFragment::MCAlignFragment
MCAlignFragment(unsigned Alignment, int64_t Value, unsigned ValueSize, unsigned MaxBytesToEmit, MCSection *Sec=nullptr)
Definition: MCFragment.h:317
llvm::MCFragment::destroy
void destroy()
Destroys the current fragment.
Definition: MCFragment.cpp:266
llvm::MCCompactEncodedInstFragment::MCCompactEncodedInstFragment
MCCompactEncodedInstFragment(MCSection *Sec=nullptr)
Definition: MCFragment.h:258
llvm::MCLEBFragment::classof
static bool classof(const MCFragment *F)
Definition: MCFragment.h:451
llvm::MCOrgFragment::getValue
uint8_t getValue() const
Definition: MCFragment.h:418
llvm::MCFragment::FT_Dwarf
@ FT_Dwarf
Definition: MCFragment.h:42
llvm::MCEncodedFragmentWithFixups::getFixups
const SmallVectorImpl< MCFixup > & getFixups() const
Definition: MCFragment.h:223
Alignment.h
llvm::MCFragment::FT_Nops
@ FT_Nops
Definition: MCFragment.h:39
llvm::MCAsmLayout
Encapsulates the layout of an assembly file at a particular point in time.
Definition: MCAsmLayout.h:28
llvm::MCEncodedFragment::getSubtargetInfo
const MCSubtargetInfo * getSubtargetInfo() const
Retrieve the MCSubTargetInfo in effect when the instruction was encoded.
Definition: MCFragment.h:172
llvm::MCFragment::setParent
void setParent(MCSection *Value)
Definition: MCFragment.h:96
llvm::MCNopsFragment::getNumBytes
int64_t getNumBytes() const
Definition: MCFragment.h:388
llvm::TargetStackID::Value
Value
Definition: TargetFrameLowering.h:27
llvm::MCEncodedFragment::getBundlePadding
uint8_t getBundlePadding() const
Get the padding size that must be inserted before this fragment.
Definition: MCFragment.h:164
llvm::MCAlignFragment::getAlignment
unsigned getAlignment() const
Definition: MCFragment.h:322
llvm::MCEncodedFragmentWithFixups::fixup_begin
fixup_iterator fixup_begin()
Definition: MCFragment.h:225
llvm::MCEncodedFragment::STI
const MCSubtargetInfo * STI
The MCSubtargetInfo in effect when the instruction was encoded.
Definition: MCFragment.h:137
llvm::SmallString::str
StringRef str() const
Explicit conversion to StringRef.
Definition: SmallString.h:260
llvm::MCFragment::FT_Relaxable
@ FT_Relaxable
Definition: MCFragment.h:40
llvm::MCRelaxableFragment::getAllowAutoPadding
bool getAllowAutoPadding() const
Definition: MCFragment.h:286
llvm::MCAlignFragment::getSubtargetInfo
const MCSubtargetInfo * getSubtargetInfo() const
Definition: MCFragment.h:336
llvm::MCOrgFragment::classof
static bool classof(const MCFragment *F)
Definition: MCFragment.h:422
llvm::MCLEBFragment
Definition: MCFragment.h:427
llvm::MCEncodedFragment::setAlignToBundleEnd
void setAlignToBundleEnd(bool V)
Definition: MCFragment.h:157
llvm::MCFragment::getLayoutOrder
unsigned getLayoutOrder() const
Definition: MCFragment.h:101
llvm::MCFragment::FT_Fill
@ FT_Fill
Definition: MCFragment.h:38
llvm::MCNopsFragment::getSubtargetInfo
const MCSubtargetInfo * getSubtargetInfo() const
Definition: MCFragment.h:393
SmallVector.h
llvm::SmallVectorImpl::iterator
typename SuperClass::iterator iterator
Definition: SmallVector.h:558
N
#define N
llvm::MCCompactEncodedInstFragment::classof
static bool classof(const MCFragment *F)
Definition: MCFragment.h:262
llvm::MCEncodedFragment::classof
static bool classof(const MCFragment *F)
Definition: MCFragment.h:140
ilist_node.h
llvm::SmallVectorImpl< char >
llvm::MCFillFragment::MCFillFragment
MCFillFragment(uint64_t Value, uint8_t VSize, const MCExpr &NumValues, SMLoc Loc, MCSection *Sec=nullptr)
Definition: MCFragment.h:354
llvm::MCFillFragment::getValueSize
uint8_t getValueSize() const
Definition: MCFragment.h:360
llvm::MCEncodedFragmentWithFixups::fixup_end
fixup_iterator fixup_end()
Definition: MCFragment.h:228
llvm::MCFragment::FT_Dummy
@ FT_Dummy
Definition: MCFragment.h:50
llvm::MCDummyFragment::MCDummyFragment
MCDummyFragment(MCSection *Sec)
Definition: MCFragment.h:116
llvm::MCDataFragment
Fragment for data and encoded instructions.
Definition: MCFragment.h:241
llvm::MCSubtargetInfo
Generic base class for all target subtargets.
Definition: MCSubtargetInfo.h:76
llvm::MCCVDefRangeFragment
Fragment representing the .cv_def_range directive.
Definition: MCFragment.h:548
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::MCEncodedFragmentWithFixups
Interface implemented by fragments that contain encoded instructions and/or data and also have fixups...
Definition: MCFragment.h:204
llvm::MCOrgFragment::getOffset
const MCExpr & getOffset() const
Definition: MCFragment.h:416
llvm::MCLEBFragment::isSigned
bool isSigned() const
Definition: MCFragment.h:444
llvm::MCExpr
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
llvm::MCFragment::getAtom
const MCSymbol * getAtom() const
Definition: MCFragment.h:98
llvm::ISD::MCSymbol
@ MCSymbol
Definition: ISDOpcodes.h:172
llvm::MCEncodedFragmentWithContents::getContents
SmallVectorImpl< char > & getContents()
Definition: MCFragment.h:196
llvm::MCCVInlineLineTableFragment::getContents
SmallString< 8 > & getContents()
Definition: MCFragment.h:539
llvm::MCFragment::FT_CompactEncodedInst
@ FT_CompactEncodedInst
Definition: MCFragment.h:37
llvm::MCNopsFragment::getControlledNopLength
int64_t getControlledNopLength() const
Definition: MCFragment.h:389
llvm::MCEncodedFragmentWithFixups::fixup_begin
const_fixup_iterator fixup_begin() const
Definition: MCFragment.h:226
llvm::MCBoundaryAlignFragment
Represents required padding such that a particular other set of fragments does not cross a particular...
Definition: MCFragment.h:578