9#ifndef LLVM_MC_MCFRAGMENT_H
10#define LLVM_MC_MCFRAGMENT_H
69 unsigned SubsectionNumber = 0;
126 bool AlignToBundleEnd =
false;
128 uint8_t BundlePadding = 0;
185template<
unsigned ContentsSize>
203template<
unsigned ContentsSize,
unsigned FixupsSize>
275 bool AllowAutoPadding =
false;
281 Inst(Inst) { this->STI = &
STI; }
311 unsigned MaxBytesToEmit;
318 unsigned MaxBytesToEmit,
MCSection *Sec =
nullptr)
320 Value(
Value), ValueSize(ValueSize), MaxBytesToEmit(MaxBytesToEmit) {}
357 NumValues(NumValues), Loc(Loc) {}
374 int64_t ControlledNopLength;
386 ControlledNopLength(ControlledNopLength), Loc(L), STI(STI) {}
469 LineDelta(LineDelta), AddrDelta(&AddrDelta) {}
488 AddrDelta(&AddrDelta) {}
517 unsigned StartFileId;
518 unsigned StartLineNum;
529 unsigned StartLineNum,
const MCSymbol *FnStartSym,
533 StartFileId(StartFileId), StartLineNum(StartLineNum),
534 FnStartSym(FnStartSym), FnEndSym(FnEndSym) {}
558 ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
561 Ranges(Ranges.begin(), Ranges.end()),
562 FixedSizePortion(FixedSizePortion) {}
623 AddrDelta(AddrDelta) {}
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),...
Holds state from .cv_file and .cv_loc directives for later emission.
void setEmitNops(bool Value, const MCSubtargetInfo *STI)
Align getAlignment() const
unsigned getMaxBytesToEmit() const
unsigned getValueSize() const
const MCSubtargetInfo * getSubtargetInfo() const
static bool classof(const MCFragment *F)
MCAlignFragment(Align Alignment, int64_t Value, unsigned ValueSize, unsigned MaxBytesToEmit, MCSection *Sec=nullptr)
Encapsulates the layout of an assembly file at a particular point in time.
Represents required padding such that a particular other set of fragments does not cross a particular...
void setAlignment(Align Value)
void setSize(uint64_t Value)
MCBoundaryAlignFragment(Align AlignBoundary, const MCSubtargetInfo &STI, MCSection *Sec=nullptr)
const MCFragment * getLastFragment() const
const MCSubtargetInfo * getSubtargetInfo() const
static bool classof(const MCFragment *F)
Align getAlignment() const
void setLastFragment(const MCFragment *F)
Fragment representing the .cv_def_range directive.
ArrayRef< std::pair< const MCSymbol *, const MCSymbol * > > getRanges() const
static bool classof(const MCFragment *F)
MCCVDefRangeFragment(ArrayRef< std::pair< const MCSymbol *, const MCSymbol * > > Ranges, StringRef FixedSizePortion, MCSection *Sec=nullptr)
StringRef getFixedSizePortion() const
Fragment representing the binary annotations produced by the .cv_inline_linetable directive.
static bool classof(const MCFragment *F)
const SmallString< 8 > & getContents() const
MCCVInlineLineTableFragment(unsigned SiteFuncId, unsigned StartFileId, unsigned StartLineNum, const MCSymbol *FnStartSym, const MCSymbol *FnEndSym, MCSection *Sec=nullptr)
const MCSymbol * getFnStartSym() const
const MCSymbol * getFnEndSym() const
SmallString< 8 > & getContents()
This is a compact (memory-size-wise) fragment for holding an encoded instruction (non-relaxable) that...
MCCompactEncodedInstFragment(MCSection *Sec=nullptr)
static bool classof(const MCFragment *F)
Fragment for data and encoded instructions.
static bool classof(const MCFragment *F)
MCDataFragment(MCSection *Sec=nullptr)
static bool classof(const MCFragment *F)
MCDummyFragment(MCSection *Sec)
MCDwarfCallFrameFragment(const MCExpr &AddrDelta, MCSection *Sec=nullptr)
static bool classof(const MCFragment *F)
const MCExpr & getAddrDelta() const
MCDwarfLineAddrFragment(int64_t LineDelta, const MCExpr &AddrDelta, MCSection *Sec=nullptr)
int64_t getLineDelta() const
static bool classof(const MCFragment *F)
const MCExpr & getAddrDelta() const
Interface implemented by fragments that contain encoded instructions and/or data.
const SmallVectorImpl< char > & getContents() const
SmallVectorImpl< char > & getContents()
MCEncodedFragmentWithContents(MCFragment::FragmentType FType, bool HasInstructions, MCSection *Sec)
Interface implemented by fragments that contain encoded instructions and/or data and also have fixups...
static bool classof(const MCFragment *F)
MCEncodedFragmentWithFixups(MCFragment::FragmentType FType, bool HasInstructions, MCSection *Sec)
const SmallVectorImpl< MCFixup > & getFixups() const
fixup_iterator fixup_end()
SmallVectorImpl< MCFixup > & getFixups()
SmallVectorImpl< MCFixup >::iterator fixup_iterator
fixup_iterator fixup_begin()
const_fixup_iterator fixup_end() const
SmallVectorImpl< MCFixup >::const_iterator const_fixup_iterator
const_fixup_iterator fixup_begin() const
Interface implemented by fragments that contain encoded instructions and/or data.
const MCSubtargetInfo * getSubtargetInfo() const
Retrieve the MCSubTargetInfo in effect when the instruction was encoded.
const MCSubtargetInfo * STI
The MCSubtargetInfo in effect when the instruction was encoded.
static bool classof(const MCFragment *F)
void setBundlePadding(uint8_t N)
Set the padding size for this fragment.
void setHasInstructions(const MCSubtargetInfo &STI)
Record that the fragment contains instructions with the MCSubtargetInfo in effect when the instructio...
uint8_t getBundlePadding() const
Get the padding size that must be inserted before this fragment.
void setAlignToBundleEnd(bool V)
bool alignToBundleEnd() const
Should this fragment be placed at the end of an aligned bundle?
MCEncodedFragment(MCFragment::FragmentType FType, bool HasInstructions, MCSection *Sec)
Base class for the full range of assembler expressions which are needed for parsing.
MCFillFragment(uint64_t Value, uint8_t VSize, const MCExpr &NumValues, SMLoc Loc, MCSection *Sec=nullptr)
uint8_t getValueSize() const
uint64_t getValue() const
static bool classof(const MCFragment *F)
const MCExpr & getNumValues() const
FragmentType getKind() const
unsigned getLayoutOrder() const
void setParent(MCSection *Value)
void setSubsectionNumber(unsigned Value)
void destroy()
Destroys the current fragment.
const MCSymbol * getAtom() const
void setLayoutOrder(unsigned Value)
MCSection * getParent() const
MCFragment(const MCFragment &)=delete
void setAtom(const MCSymbol *Value)
MCFragment & operator=(const MCFragment &)=delete
bool hasInstructions() const
Does this fragment have instructions emitted into it? By default this is false, but specific fragment...
unsigned getSubsectionNumber() const
Instances of this class represent a single low-level machine instruction.
const SmallString< 8 > & getContents() const
const MCExpr & getValue() const
static bool classof(const MCFragment *F)
MCLEBFragment(const MCExpr &Value_, bool IsSigned_, MCSection *Sec=nullptr)
SmallString< 8 > & getContents()
int64_t getControlledNopLength() const
int64_t getNumBytes() const
MCNopsFragment(int64_t NumBytes, int64_t ControlledNopLength, SMLoc L, const MCSubtargetInfo &STI, MCSection *Sec=nullptr)
static bool classof(const MCFragment *F)
const MCSubtargetInfo * getSubtargetInfo() const
MCOrgFragment(const MCExpr &Offset, int8_t Value, SMLoc Loc, MCSection *Sec=nullptr)
static bool classof(const MCFragment *F)
const MCExpr & getOffset() const
MCPseudoProbeAddrFragment(const MCExpr *AddrDelta, MCSection *Sec=nullptr)
const MCExpr & getAddrDelta() const
static bool classof(const MCFragment *F)
A relaxable fragment holds on to its MCInst, since it may need to be relaxed during the assembler lay...
void setAllowAutoPadding(bool V)
static bool classof(const MCFragment *F)
bool getAllowAutoPadding() const
const MCInst & getInst() const
MCRelaxableFragment(const MCInst &Inst, const MCSubtargetInfo &STI, MCSection *Sec=nullptr)
void setInst(const MCInst &Value)
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Generic base class for all target subtargets.
Represents a symbol table index fragment.
const MCSymbol * getSymbol() const
MCSymbolIdFragment(const MCSymbol *Sym, MCSection *Sec=nullptr)
static bool classof(const MCFragment *F)
const MCSymbol * getSymbol()
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Represents a location in source code.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
StringRef str() const
Explicit conversion to StringRef.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
typename SuperClass::const_iterator const_iterator
typename SuperClass::iterator iterator
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
LLVM Value Representation.
An ilist node that can access its parent list.
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.
This struct is a compact representation of a valid (non-zero power of two) alignment.