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