LLVM  6.0.0svn
MCFragment.h
Go to the documentation of this file.
1 //===- MCFragment.h - Fragment type hierarchy -------------------*- 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 #ifndef LLVM_MC_MCFRAGMENT_H
11 #define LLVM_MC_MCFRAGMENT_H
12 
13 #include "llvm/ADT/ArrayRef.h"
14 #include "llvm/ADT/SmallString.h"
15 #include "llvm/ADT/SmallVector.h"
16 #include "llvm/ADT/StringRef.h"
17 #include "llvm/ADT/ilist_node.h"
18 #include "llvm/MC/MCFixup.h"
19 #include "llvm/MC/MCInst.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 {
48  };
49 
50 private:
52 
53 protected:
55 
56 private:
57  /// \brief Should this fragment be aligned to the end of a bundle?
58  bool AlignToBundleEnd;
59 
60  uint8_t BundlePadding;
61 
62  /// LayoutOrder - The layout order of this fragment.
63  unsigned LayoutOrder;
64 
65  /// The data for the section this fragment is in.
66  MCSection *Parent;
67 
68  /// Atom - The atom this fragment is in, as represented by it's defining
69  /// symbol.
70  const MCSymbol *Atom;
71 
72  /// \name Assembler Backend Data
73  /// @{
74  //
75  // FIXME: This could all be kept private to the assembler implementation.
76 
77  /// Offset - The offset of this fragment in its section. This is ~0 until
78  /// initialized.
79  uint64_t Offset;
80 
81  /// @}
82 
83 protected:
84  MCFragment(FragmentType Kind, bool HasInstructions,
85  uint8_t BundlePadding, MCSection *Parent = nullptr);
86 
87  ~MCFragment();
88 
89 public:
90  MCFragment() = delete;
91  MCFragment(const MCFragment &) = delete;
92  MCFragment &operator=(const MCFragment &) = delete;
93 
94  /// Destroys the current fragment.
95  ///
96  /// This must be used instead of delete as MCFragment is non-virtual.
97  /// This method will dispatch to the appropriate subclass.
98  void destroy();
99 
100  FragmentType getKind() const { return Kind; }
101 
102  MCSection *getParent() const { return Parent; }
103  void setParent(MCSection *Value) { Parent = Value; }
104 
105  const MCSymbol *getAtom() const { return Atom; }
106  void setAtom(const MCSymbol *Value) { Atom = Value; }
107 
108  unsigned getLayoutOrder() const { return LayoutOrder; }
109  void setLayoutOrder(unsigned Value) { LayoutOrder = Value; }
110 
111  /// \brief Does this fragment have instructions emitted into it? By default
112  /// this is false, but specific fragment types may set it to true.
113  bool hasInstructions() const { return HasInstructions; }
114 
115  /// \brief Should this fragment be placed at the end of an aligned bundle?
116  bool alignToBundleEnd() const { return AlignToBundleEnd; }
117  void setAlignToBundleEnd(bool V) { AlignToBundleEnd = V; }
118 
119  /// \brief Get the padding size that must be inserted before this fragment.
120  /// Used for bundling. By default, no padding is inserted.
121  /// Note that padding size is restricted to 8 bits. This is an optimization
122  /// to reduce the amount of space used for each fragment. In practice, larger
123  /// padding should never be required.
124  uint8_t getBundlePadding() const { return BundlePadding; }
125 
126  /// \brief Set the padding size for this fragment. By default it's a no-op,
127  /// and only some fragments have a meaningful implementation.
128  void setBundlePadding(uint8_t N) { BundlePadding = N; }
129 
130  /// \brief Return true if given frgment has FT_Dummy type.
131  bool isDummy() const { return Kind == FT_Dummy; }
132 
133  void dump() const;
134 };
135 
136 class MCDummyFragment : public MCFragment {
137 public:
138  explicit MCDummyFragment(MCSection *Sec)
139  : MCFragment(FT_Dummy, false, 0, Sec) {}
140 
141  static bool classof(const MCFragment *F) { return F->getKind() == FT_Dummy; }
142 };
143 
144 /// Interface implemented by fragments that contain encoded instructions and/or
145 /// data.
146 ///
148 protected:
150  MCSection *Sec)
151  : MCFragment(FType, HasInstructions, 0, Sec) {}
152 
153 public:
154  static bool classof(const MCFragment *F) {
155  MCFragment::FragmentType Kind = F->getKind();
156  switch (Kind) {
157  default:
158  return false;
161  case MCFragment::FT_Data:
162  return true;
163  }
164  }
165 };
166 
167 /// Interface implemented by fragments that contain encoded instructions and/or
168 /// data.
169 ///
170 template<unsigned ContentsSize>
173 
174 protected:
176  bool HasInstructions,
177  MCSection *Sec)
178  : MCEncodedFragment(FType, HasInstructions, Sec) {}
179 
180 public:
181  SmallVectorImpl<char> &getContents() { return Contents; }
182  const SmallVectorImpl<char> &getContents() const { return Contents; }
183 };
184 
185 /// Interface implemented by fragments that contain encoded instructions and/or
186 /// data and also have fixups registered.
187 ///
188 template<unsigned ContentsSize, unsigned FixupsSize>
190  public MCEncodedFragmentWithContents<ContentsSize> {
191 
192  /// Fixups - The list of fixups in this fragment.
194 
195 protected:
197  bool HasInstructions,
198  MCSection *Sec)
199  : MCEncodedFragmentWithContents<ContentsSize>(FType, HasInstructions,
200  Sec) {}
201 
202 public:
205 
207  const SmallVectorImpl<MCFixup> &getFixups() const { return Fixups; }
208 
209  fixup_iterator fixup_begin() { return Fixups.begin(); }
210  const_fixup_iterator fixup_begin() const { return Fixups.begin(); }
211 
212  fixup_iterator fixup_end() { return Fixups.end(); }
213  const_fixup_iterator fixup_end() const { return Fixups.end(); }
214 
215  static bool classof(const MCFragment *F) {
216  MCFragment::FragmentType Kind = F->getKind();
217  return Kind == MCFragment::FT_Relaxable || Kind == MCFragment::FT_Data ||
219  }
220 };
221 
222 /// Fragment for data and encoded instructions.
223 ///
225 public:
226  MCDataFragment(MCSection *Sec = nullptr)
227  : MCEncodedFragmentWithFixups<32, 4>(FT_Data, false, Sec) {}
228 
229  void setHasInstructions(bool V) { HasInstructions = V; }
230 
231  static bool classof(const MCFragment *F) {
232  return F->getKind() == MCFragment::FT_Data;
233  }
234 };
235 
236 /// This is a compact (memory-size-wise) fragment for holding an encoded
237 /// instruction (non-relaxable) that has no fixups registered. When applicable,
238 /// it can be used instead of MCDataFragment and lead to lower memory
239 /// consumption.
240 ///
242 public:
245  }
246 
247  static bool classof(const MCFragment *F) {
249  }
250 };
251 
252 /// A relaxable fragment holds on to its MCInst, since it may need to be
253 /// relaxed during the assembler layout and relaxation stage.
254 ///
256 
257  /// Inst - The instruction this is a fragment for.
258  MCInst Inst;
259 
260  /// STI - The MCSubtargetInfo in effect when the instruction was encoded.
261  const MCSubtargetInfo &STI;
262 
263 public:
264  MCRelaxableFragment(const MCInst &Inst, const MCSubtargetInfo &STI,
265  MCSection *Sec = nullptr)
267  Inst(Inst), STI(STI) {}
268 
269  const MCInst &getInst() const { return Inst; }
270  void setInst(const MCInst &Value) { Inst = Value; }
271 
272  const MCSubtargetInfo &getSubtargetInfo() { return STI; }
273 
274  static bool classof(const MCFragment *F) {
275  return F->getKind() == MCFragment::FT_Relaxable;
276  }
277 };
278 
279 class MCAlignFragment : public MCFragment {
280  /// Alignment - The alignment to ensure, in bytes.
281  unsigned Alignment;
282 
283  /// EmitNops - Flag to indicate that (optimal) NOPs should be emitted instead
284  /// of using the provided value. The exact interpretation of this flag is
285  /// target dependent.
286  bool EmitNops : 1;
287 
288  /// Value - Value to use for filling padding bytes.
289  int64_t Value;
290 
291  /// ValueSize - The size of the integer (in bytes) of \p Value.
292  unsigned ValueSize;
293 
294  /// MaxBytesToEmit - The maximum number of bytes to emit; if the alignment
295  /// cannot be satisfied in this width then this fragment is ignored.
296  unsigned MaxBytesToEmit;
297 
298 public:
299  MCAlignFragment(unsigned Alignment, int64_t Value, unsigned ValueSize,
300  unsigned MaxBytesToEmit, MCSection *Sec = nullptr)
301  : MCFragment(FT_Align, false, 0, Sec), Alignment(Alignment),
302  EmitNops(false), Value(Value),
303  ValueSize(ValueSize), MaxBytesToEmit(MaxBytesToEmit) {}
304 
305  /// \name Accessors
306  /// @{
307 
308  unsigned getAlignment() const { return Alignment; }
309 
310  int64_t getValue() const { return Value; }
311 
312  unsigned getValueSize() const { return ValueSize; }
313 
314  unsigned getMaxBytesToEmit() const { return MaxBytesToEmit; }
315 
316  bool hasEmitNops() const { return EmitNops; }
317  void setEmitNops(bool Value) { EmitNops = Value; }
318 
319  /// @}
320 
321  static bool classof(const MCFragment *F) {
322  return F->getKind() == MCFragment::FT_Align;
323  }
324 };
325 
326 class MCFillFragment : public MCFragment {
327  /// Value to use for filling bytes.
328  uint8_t Value;
329 
330  /// The number of bytes to insert.
331  uint64_t Size;
332 
333 public:
334  MCFillFragment(uint8_t Value, uint64_t Size, MCSection *Sec = nullptr)
335  : MCFragment(FT_Fill, false, 0, Sec), Value(Value), Size(Size) {}
336 
337  uint8_t getValue() const { return Value; }
338  uint64_t getSize() const { return Size; }
339 
340  static bool classof(const MCFragment *F) {
341  return F->getKind() == MCFragment::FT_Fill;
342  }
343 };
344 
345 class MCOrgFragment : public MCFragment {
346  /// Offset - The offset this fragment should start at.
347  const MCExpr *Offset;
348 
349  /// Value - Value to use for filling bytes.
350  int8_t Value;
351 
352  /// Loc - Source location of the directive that this fragment was created for.
353  SMLoc Loc;
354 
355 public:
356  MCOrgFragment(const MCExpr &Offset, int8_t Value, SMLoc Loc,
357  MCSection *Sec = nullptr)
358  : MCFragment(FT_Org, false, 0, Sec), Offset(&Offset), Value(Value), Loc(Loc) {}
359 
360  /// \name Accessors
361  /// @{
362 
363  const MCExpr &getOffset() const { return *Offset; }
364 
365  uint8_t getValue() const { return Value; }
366 
367  SMLoc getLoc() const { return Loc; }
368 
369  /// @}
370 
371  static bool classof(const MCFragment *F) {
372  return F->getKind() == MCFragment::FT_Org;
373  }
374 };
375 
376 class MCLEBFragment : public MCFragment {
377  /// Value - The value this fragment should contain.
378  const MCExpr *Value;
379 
380  /// IsSigned - True if this is a sleb128, false if uleb128.
381  bool IsSigned;
382 
383  SmallString<8> Contents;
384 
385 public:
386  MCLEBFragment(const MCExpr &Value_, bool IsSigned_, MCSection *Sec = nullptr)
387  : MCFragment(FT_LEB, false, 0, Sec), Value(&Value_), IsSigned(IsSigned_) {
388  Contents.push_back(0);
389  }
390 
391  /// \name Accessors
392  /// @{
393 
394  const MCExpr &getValue() const { return *Value; }
395 
396  bool isSigned() const { return IsSigned; }
397 
398  SmallString<8> &getContents() { return Contents; }
399  const SmallString<8> &getContents() const { return Contents; }
400 
401  /// @}
402 
403  static bool classof(const MCFragment *F) {
404  return F->getKind() == MCFragment::FT_LEB;
405  }
406 };
407 
409  /// LineDelta - the value of the difference between the two line numbers
410  /// between two .loc dwarf directives.
411  int64_t LineDelta;
412 
413  /// AddrDelta - The expression for the difference of the two symbols that
414  /// make up the address delta between two .loc dwarf directives.
415  const MCExpr *AddrDelta;
416 
417  SmallString<8> Contents;
418 
419 public:
420  MCDwarfLineAddrFragment(int64_t LineDelta, const MCExpr &AddrDelta,
421  MCSection *Sec = nullptr)
422  : MCFragment(FT_Dwarf, false, 0, Sec), LineDelta(LineDelta),
423  AddrDelta(&AddrDelta) {
424  Contents.push_back(0);
425  }
426 
427  /// \name Accessors
428  /// @{
429 
430  int64_t getLineDelta() const { return LineDelta; }
431 
432  const MCExpr &getAddrDelta() const { return *AddrDelta; }
433 
434  SmallString<8> &getContents() { return Contents; }
435  const SmallString<8> &getContents() const { return Contents; }
436 
437  /// @}
438 
439  static bool classof(const MCFragment *F) {
440  return F->getKind() == MCFragment::FT_Dwarf;
441  }
442 };
443 
445  /// AddrDelta - The expression for the difference of the two symbols that
446  /// make up the address delta between two .cfi_* dwarf directives.
447  const MCExpr *AddrDelta;
448 
449  SmallString<8> Contents;
450 
451 public:
452  MCDwarfCallFrameFragment(const MCExpr &AddrDelta, MCSection *Sec = nullptr)
453  : MCFragment(FT_DwarfFrame, false, 0, Sec), AddrDelta(&AddrDelta) {
454  Contents.push_back(0);
455  }
456 
457  /// \name Accessors
458  /// @{
459 
460  const MCExpr &getAddrDelta() const { return *AddrDelta; }
461 
462  SmallString<8> &getContents() { return Contents; }
463  const SmallString<8> &getContents() const { return Contents; }
464 
465  /// @}
466 
467  static bool classof(const MCFragment *F) {
468  return F->getKind() == MCFragment::FT_DwarfFrame;
469  }
470 };
471 
473  const MCSymbol *Sym;
474 
475 public:
476  MCSafeSEHFragment(const MCSymbol *Sym, MCSection *Sec = nullptr)
477  : MCFragment(FT_SafeSEH, false, 0, Sec), Sym(Sym) {}
478 
479  /// \name Accessors
480  /// @{
481 
482  const MCSymbol *getSymbol() { return Sym; }
483  const MCSymbol *getSymbol() const { return Sym; }
484 
485  /// @}
486 
487  static bool classof(const MCFragment *F) {
488  return F->getKind() == MCFragment::FT_SafeSEH;
489  }
490 };
491 
492 /// Fragment representing the binary annotations produced by the
493 /// .cv_inline_linetable directive.
495  unsigned SiteFuncId;
496  unsigned StartFileId;
497  unsigned StartLineNum;
498  const MCSymbol *FnStartSym;
499  const MCSymbol *FnEndSym;
500  SmallString<8> Contents;
501 
502  /// CodeViewContext has the real knowledge about this format, so let it access
503  /// our members.
504  friend class CodeViewContext;
505 
506 public:
507  MCCVInlineLineTableFragment(unsigned SiteFuncId, unsigned StartFileId,
508  unsigned StartLineNum, const MCSymbol *FnStartSym,
509  const MCSymbol *FnEndSym,
510  MCSection *Sec = nullptr)
511  : MCFragment(FT_CVInlineLines, false, 0, Sec), SiteFuncId(SiteFuncId),
512  StartFileId(StartFileId), StartLineNum(StartLineNum),
513  FnStartSym(FnStartSym), FnEndSym(FnEndSym) {}
514 
515  /// \name Accessors
516  /// @{
517 
518  const MCSymbol *getFnStartSym() const { return FnStartSym; }
519  const MCSymbol *getFnEndSym() const { return FnEndSym; }
520 
521  SmallString<8> &getContents() { return Contents; }
522  const SmallString<8> &getContents() const { return Contents; }
523 
524  /// @}
525 
526  static bool classof(const MCFragment *F) {
527  return F->getKind() == MCFragment::FT_CVInlineLines;
528  }
529 };
530 
531 /// Fragment representing the .cv_def_range directive.
534  SmallString<32> FixedSizePortion;
535 
536  /// CodeViewContext has the real knowledge about this format, so let it access
537  /// our members.
538  friend class CodeViewContext;
539 
540 public:
542  ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
543  StringRef FixedSizePortion, MCSection *Sec = nullptr)
545  Ranges(Ranges.begin(), Ranges.end()),
546  FixedSizePortion(FixedSizePortion) {}
547 
548  /// \name Accessors
549  /// @{
551  return Ranges;
552  }
553 
554  StringRef getFixedSizePortion() const { return FixedSizePortion; }
555  /// @}
556 
557  static bool classof(const MCFragment *F) {
558  return F->getKind() == MCFragment::FT_CVDefRange;
559  }
560 };
561 
562 } // end namespace llvm
563 
564 #endif // LLVM_MC_MCFRAGMENT_H
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:39
void push_back(const T &Elt)
Definition: SmallVector.h:212
const_iterator end(StringRef path)
Get end iterator over path.
Definition: Path.cpp:243
MCAlignFragment(unsigned Alignment, int64_t Value, unsigned ValueSize, unsigned MaxBytesToEmit, MCSection *Sec=nullptr)
Definition: MCFragment.h:299
MCOrgFragment(const MCExpr &Offset, int8_t Value, SMLoc Loc, MCSection *Sec=nullptr)
Definition: MCFragment.h:356
static bool classof(const MCFragment *F)
Definition: MCFragment.h:403
bool alignToBundleEnd() const
Should this fragment be placed at the end of an aligned bundle?
Definition: MCFragment.h:116
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
Definition: Path.cpp:234
typename SuperClass::const_iterator const_iterator
Definition: SmallVector.h:329
MCDwarfLineAddrFragment(int64_t LineDelta, const MCExpr &AddrDelta, MCSection *Sec=nullptr)
Definition: MCFragment.h:420
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
static bool classof(const MCFragment *F)
Definition: MCFragment.h:340
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:42
SmallString< 8 > & getContents()
Definition: MCFragment.h:521
static bool classof(const MCFragment *F)
Definition: MCFragment.h:141
const SmallString< 8 > & getContents() const
Definition: MCFragment.h:463
int64_t getValue() const
Definition: MCFragment.h:310
Interface implemented by fragments that contain encoded instructions and/or data. ...
Definition: MCFragment.h:171
static bool classof(const MCFragment *F)
Definition: MCFragment.h:487
MCFragment & operator=(const MCFragment &)=delete
FragmentType getKind() const
Definition: MCFragment.h:100
This is a compact (memory-size-wise) fragment for holding an encoded instruction (non-relaxable) that...
Definition: MCFragment.h:241
F(f)
const MCSubtargetInfo & getSubtargetInfo()
Definition: MCFragment.h:272
const MCExpr & getOffset() const
Definition: MCFragment.h:363
static void EmitNops(MCStreamer &OS, unsigned NumBytes, bool Is64Bit, const MCSubtargetInfo &STI)
Emit the optimal amount of multi-byte nops on X86.
StringRef getFixedSizePortion() const
Definition: MCFragment.h:554
const_fixup_iterator fixup_begin() const
Definition: MCFragment.h:210
MCFillFragment(uint8_t Value, uint64_t Size, MCSection *Sec=nullptr)
Definition: MCFragment.h:334
bool HasInstructions
Definition: MCFragment.h:54
Interface implemented by fragments that contain encoded instructions and/or data. ...
Definition: MCFragment.h:147
SmallVectorImpl< MCFixup >::const_iterator const_fixup_iterator
Definition: MCFragment.h:203
Encapsulates the layout of an assembly file at a particular point in time.
Definition: MCAsmLayout.h:29
const_fixup_iterator fixup_end() const
Definition: MCFragment.h:213
void setEmitNops(bool Value)
Definition: MCFragment.h:317
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:36
void setAlignToBundleEnd(bool V)
Definition: MCFragment.h:117
const SmallString< 8 > & getContents() const
Definition: MCFragment.h:522
MCDummyFragment(MCSection *Sec)
Definition: MCFragment.h:138
SMLoc getLoc() const
Definition: MCFragment.h:367
void destroy()
Destroys the current fragment.
Definition: MCFragment.cpp:246
const MCExpr & getAddrDelta() const
Definition: MCFragment.h:432
void setHasInstructions(bool V)
Definition: MCFragment.h:229
static bool classof(const MCFragment *F)
Definition: MCFragment.h:439
static bool classof(const MCFragment *F)
Definition: MCFragment.h:154
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:33
const MCExpr & getAddrDelta() const
Definition: MCFragment.h:460
const MCSymbol * getSymbol()
Definition: MCFragment.h:482
MCLEBFragment(const MCExpr &Value_, bool IsSigned_, MCSection *Sec=nullptr)
Definition: MCFragment.h:386
MCEncodedFragmentWithContents(MCFragment::FragmentType FType, bool HasInstructions, MCSection *Sec)
Definition: MCFragment.h:175
bool isDummy() const
Return true if given frgment has FT_Dummy type.
Definition: MCFragment.h:131
SmallVectorImpl< char > & getContents()
Definition: MCFragment.h:181
MCSafeSEHFragment(const MCSymbol *Sym, MCSection *Sec=nullptr)
Definition: MCFragment.h:476
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:159
MCRelaxableFragment(const MCInst &Inst, const MCSubtargetInfo &STI, MCSection *Sec=nullptr)
Definition: MCFragment.h:264
void dump() const
Definition: MCFragment.cpp:310
A relaxable fragment holds on to its MCInst, since it may need to be relaxed during the assembler lay...
Definition: MCFragment.h:255
uint8_t getValue() const
Definition: MCFragment.h:337
An ilist node that can access its parent list.
Definition: ilist_node.h:257
static bool classof(const MCFragment *F)
Definition: MCFragment.h:371
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
Definition: SmallVector.h:116
static bool classof(const MCFragment *F)
Definition: MCFragment.h:274
const SmallVectorImpl< char > & getContents() const
Definition: MCFragment.h:182
static bool classof(const MCFragment *F)
Definition: MCFragment.h:215
SmallVectorImpl< MCFixup > & getFixups()
Definition: MCFragment.h:206
MCEncodedFragment(MCFragment::FragmentType FType, bool HasInstructions, MCSection *Sec)
Definition: MCFragment.h:149
const SmallString< 8 > & getContents() const
Definition: MCFragment.h:399
const MCSymbol * getAtom() const
Definition: MCFragment.h:105
MCCVInlineLineTableFragment(unsigned SiteFuncId, unsigned StartFileId, unsigned StartLineNum, const MCSymbol *FnStartSym, const MCSymbol *FnEndSym, MCSection *Sec=nullptr)
Definition: MCFragment.h:507
static bool classof(const MCFragment *F)
Definition: MCFragment.h:321
Fragment representing the .cv_def_range directive.
Definition: MCFragment.h:532
MCCVDefRangeFragment(ArrayRef< std::pair< const MCSymbol *, const MCSymbol *>> Ranges, StringRef FixedSizePortion, MCSection *Sec=nullptr)
Definition: MCFragment.h:541
const MCExpr & getValue() const
Definition: MCFragment.h:394
MCEncodedFragmentWithFixups(MCFragment::FragmentType FType, bool HasInstructions, MCSection *Sec)
Definition: MCFragment.h:196
unsigned getMaxBytesToEmit() const
Definition: MCFragment.h:314
const SmallString< 8 > & getContents() const
Definition: MCFragment.h:435
bool hasEmitNops() const
Definition: MCFragment.h:316
MCCompactEncodedInstFragment(MCSection *Sec=nullptr)
Definition: MCFragment.h:243
SmallVectorImpl< MCFixup >::iterator fixup_iterator
Definition: MCFragment.h:204
unsigned getLayoutOrder() const
Definition: MCFragment.h:108
const MCSymbol * getFnEndSym() const
Definition: MCFragment.h:519
MCSection * getParent() const
Definition: MCFragment.h:102
bool hasInstructions() const
Does this fragment have instructions emitted into it? By default this is false, but specific fragment...
Definition: MCFragment.h:113
typename SuperClass::iterator iterator
Definition: SmallVector.h:328
SmallString< 8 > & getContents()
Definition: MCFragment.h:462
Fragment representing the binary annotations produced by the .cv_inline_linetable directive...
Definition: MCFragment.h:494
const MCSymbol * getFnStartSym() const
Definition: MCFragment.h:518
void setBundlePadding(uint8_t N)
Set the padding size for this fragment.
Definition: MCFragment.h:128
unsigned getValueSize() const
Definition: MCFragment.h:312
static bool classof(const MCFragment *F)
Definition: MCFragment.h:247
unsigned getAlignment() const
Definition: MCFragment.h:308
Basic Alias true
Interface implemented by fragments that contain encoded instructions and/or data and also have fixups...
Definition: MCFragment.h:189
uint64_t getSize() const
Definition: MCFragment.h:338
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
Definition: SmallVector.h:120
int64_t getLineDelta() const
Definition: MCFragment.h:430
const MCInst & getInst() const
Definition: MCFragment.h:269
static bool classof(const MCFragment *F)
Definition: MCFragment.h:467
#define N
static bool classof(const MCFragment *F)
Definition: MCFragment.h:557
MCSubtargetInfo - Generic base class for all target subtargets.
SmallString< 8 > & getContents()
Definition: MCFragment.h:398
void setLayoutOrder(unsigned Value)
Definition: MCFragment.h:109
const unsigned Kind
Fragment for data and encoded instructions.
Definition: MCFragment.h:224
MCFragment()=delete
bool isSigned() const
Definition: MCFragment.h:396
LLVM Value Representation.
Definition: Value.h:73
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
ArrayRef< std::pair< const MCSymbol *, const MCSymbol * > > getRanges() const
Definition: MCFragment.h:550
static bool classof(const MCFragment *F)
Definition: MCFragment.h:231
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
uint8_t getValue() const
Definition: MCFragment.h:365
const SmallVectorImpl< MCFixup > & getFixups() const
Definition: MCFragment.h:207
const MCSymbol * getSymbol() const
Definition: MCFragment.h:483
SmallString< 8 > & getContents()
Definition: MCFragment.h:434
Represents a location in source code.
Definition: SMLoc.h:24
void setParent(MCSection *Value)
Definition: MCFragment.h:103
MCDataFragment(MCSection *Sec=nullptr)
Definition: MCFragment.h:226
MCDwarfCallFrameFragment(const MCExpr &AddrDelta, MCSection *Sec=nullptr)
Definition: MCFragment.h:452
void setInst(const MCInst &Value)
Definition: MCFragment.h:270
uint8_t getBundlePadding() const
Get the padding size that must be inserted before this fragment.
Definition: MCFragment.h:124
void setAtom(const MCSymbol *Value)
Definition: MCFragment.h:106
Holds state from .cv_file and .cv_loc directives for later emission.
Definition: MCCodeView.h:158
static bool classof(const MCFragment *F)
Definition: MCFragment.h:526