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