13#ifndef LLVM_MC_MCSECTION_H
14#define LLVM_MC_MCSECTION_H
78 unsigned LayoutOrder = 0;
87 bool LinkerRelaxable : 1;
90 bool HasInstructions : 1;
92 bool AllowAutoPadding : 1;
129 unsigned MaxBytesToEmit;
137 Align PreferredAlign;
170 bool HasInstructions =
false);
199 HasInstructions =
true;
221 size_t getVarSize()
const {
return VarContentEnd - VarContentStart; }
223 return FixedSize + (VarContentEnd - VarContentStart);
248 return u.relax.Opcode;
256 unsigned MaxBytesToEmit) {
258 u.align.EmitNops =
false;
259 u.align.Alignment = Alignment;
261 u.align.FillLen = FillLen;
262 u.align.MaxBytesToEmit = MaxBytesToEmit;
267 return u.align.Alignment;
275 return u.align.FillLen;
279 return u.align.MaxBytesToEmit;
283 return u.align.EmitNops;
294 u.prefalign.End = &
End;
295 u.prefalign.PreferredAlign = PrefAlign;
296 u.prefalign.ComputedAlign =
Align();
297 u.prefalign.EmitNops = EmitNops;
298 u.prefalign.Fill = Fill;
302 return *u.prefalign.End;
306 return u.prefalign.PreferredAlign;
310 return u.prefalign.ComputedAlign;
314 u.prefalign.ComputedAlign =
A;
318 return u.prefalign.EmitNops;
322 return u.prefalign.Fill;
329 u.leb.IsSigned = IsSigned;
342 return u.leb.IsSigned;
348 return *u.dwarf.AddrDelta;
352 u.dwarf.AddrDelta =
E;
356 return u.dwarf.LineDelta;
360 u.dwarf.LineDelta = LineDelta;
366 return *u.sframe.AddrDelta;
370 u.sframe.AddrDelta =
E;
374 return u.sframe.FDEFragment;
378 u.sframe.FDEFragment =
F;
399 NumValues(NumValues), Loc(Loc) {}
416 int64_t ControlledNopLength;
425 ControlledNopLength(ControlledNopLength), Loc(L) {
481 unsigned StartFileId;
482 unsigned StartLineNum;
492 unsigned StartLineNum,
const MCSymbol *FnStartSym,
495 StartFileId(StartFileId), StartLineNum(StartLineNum),
496 FnStartSym(FnStartSym), FnEndSym(FnEndSym) {}
517 ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges,
520 FixedSizePortion(FixedSizePortion) {}
547 bool AlignToEnd =
false;
611 unsigned Ordinal = 0;
615 unsigned FirstLinkerRelaxable = -1u;
618 bool HasInstructions : 1;
620 bool IsRegistered : 1;
659 bool hasEnded()
const;
666 if (Alignment < MinAlignment)
667 Alignment = MinAlignment;
691 return Subsections.empty() ? 0 : Subsections.back().first;
697 *FragToSyms =
nullptr)
const;
705 return {
reinterpret_cast<char *
>(
this + 1), FixedSize};
708 return {
reinterpret_cast<const char *
>(
this + 1), FixedSize};
713 .
slice(VarContentStart, VarContentEnd - VarContentStart);
717 .
slice(VarContentStart, VarContentEnd - VarContentStart);
724 .
slice(FixupStart, FixupEnd - FixupStart);
728 .
slice(FixupStart, FixupEnd - FixupStart);
733 .
slice(VarFixupStart, VarFixupSize);
743 .slice(u.relax.OperandStart, u.relax.OperandSize);
751 .slice(u.relax.OperandStart, u.relax.OperandSize));
760 u.relax.OperandStart = S.size();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static uint64_t align(uint64_t Size)
This file defines the DenseMap class.
This file defines the SmallString class.
This file defines the SmallVector class.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
ArrayRef< T > slice(size_t N, size_t M) const
slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array.
void setAlignToEnd(bool Value)
MCBoundaryAlignFragment(Align AlignBoundary, const MCSubtargetInfo &STI)
void setAlignment(Align Value)
void setSize(uint64_t Value)
const MCFragment * getLastFragment() const
static bool classof(const MCFragment *F)
bool isAlignToEnd() const
Align getAlignment() const
void setLastFragment(const MCFragment *F)
MCCVDefRangeFragment(ArrayRef< std::pair< const MCSymbol *, const MCSymbol * > > Ranges, StringRef FixedSizePortion)
ArrayRef< std::pair< const MCSymbol *, const MCSymbol * > > getRanges() const
static bool classof(const MCFragment *F)
StringRef getFixedSizePortion() const
friend class CodeViewContext
CodeViewContext has the real knowledge about this format, so let it access our members.
static bool classof(const MCFragment *F)
MCCVInlineLineTableFragment(unsigned SiteFuncId, unsigned StartFileId, unsigned StartLineNum, const MCSymbol *FnStartSym, const MCSymbol *FnEndSym)
const MCSymbol * getFnStartSym() const
friend class CodeViewContext
CodeViewContext has the real knowledge about this format, so let it access our members.
const MCSymbol * getFnEndSym() const
Context object for machine code objects.
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)
uint8_t getValueSize() const
uint64_t getValue() const
static bool classof(const MCFragment *F)
const MCExpr & getNumValues() const
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
LLVM_ABI void moveFixupsToEnd()
const MCExpr & getDwarfAddrDelta() const
MutableArrayRef< char > getContents()
MCFragment * getSFrameFDE() const
bool getAllowAutoPadding() const
Align getPrefAlignPreferred() const
FragmentType getKind() const
bool isLinkerRelaxable() const
void setAllowAutoPadding(bool V)
unsigned getLayoutOrder() const
LLVM_ABI void insertRelocFixups(ArrayRef< MCFixup > Fixups)
LLVM_ABI MCFragment(FragmentType Kind=MCFragment::FT_Data, bool HasInstructions=false)
bool hasAlignEmitNops() const
friend class MCObjectStreamer
void setSFrameAddrDelta(const MCExpr *E)
void setParent(MCSection *Value)
LLVM_ABI const MCSymbol * getAtom() const
LLVM_ABI void appendFixups(ArrayRef< MCFixup > Fixups)
void setDwarfLineDelta(int64_t LineDelta)
unsigned getAlignMaxBytesToEmit() const
int64_t getDwarfLineDelta() const
bool getPrefAlignEmitNops() const
unsigned getOpcode() const
MutableArrayRef< MCFixup > getFixups()
void setLayoutOrder(unsigned Value)
void setSFrameFDE(MCFragment *F)
const MCExpr & getLEBValue() const
void makePrefAlign(Align PrefAlign, const MCSymbol &End, bool EmitNops, uint8_t Fill)
LLVM_ABI void dump() const
uint8_t getPrefAlignFill() const
MCSection * getParent() const
void makeAlign(Align Alignment, int64_t Fill, uint8_t FillLen, unsigned MaxBytesToEmit)
LLVM_ABI void setVarFixups(ArrayRef< MCFixup > Fixups)
MCFragment * getNext() const
const MCSubtargetInfo * STI
MCFragment(const MCFragment &)=delete
Align getPrefAlignComputed() const
ArrayRef< MCOperand > getOperands() const
LLVM_ABI void addFixup(MCFixup Fixup)
void setLinkerRelaxable()
Align getAlignment() const
size_t getFixedSize() const
int64_t getAlignFill() const
MCFragment & operator=(const MCFragment &)=delete
void makeLEB(bool IsSigned, const MCExpr *Value)
bool hasInstructions() const
Does this fragment have instructions emitted into it?
void setPrefAlignComputed(Align A)
uint8_t getAlignFillLen() const
void setDwarfAddrDelta(const MCExpr *E)
void setLEBValue(const MCExpr *Expr)
size_t getVarSize() const
const MCSymbol & getPrefAlignEnd() const
LLVM_ABI void setVarContents(ArrayRef< char > Contents)
MutableArrayRef< char > getVarContents()
const MCSubtargetInfo * getSubtargetInfo() const
Retrieve the MCSubTargetInfo in effect when the instruction was encoded.
void setHasInstructions(const MCSubtargetInfo &STI)
Record that the fragment contains instructions with the MCSubtargetInfo in effect when the instructio...
const MCExpr & getSFrameAddrDelta() const
MutableArrayRef< MCFixup > getVarFixups()
void setInst(const MCInst &Inst)
Instances of this class represent a single low-level machine instruction.
unsigned getNumOperands() const
unsigned getFlags() const
unsigned getOpcode() const
void setFlags(unsigned F)
void setOperands(ArrayRef< MCOperand > Ops)
void setOpcode(unsigned Op)
int64_t getControlledNopLength() const
int64_t getNumBytes() const
MCNopsFragment(int64_t NumBytes, int64_t ControlledNopLength, SMLoc L, const MCSubtargetInfo &STI)
static bool classof(const MCFragment *F)
Streaming object file generation interface.
static bool classof(const MCFragment *F)
const MCExpr & getOffset() const
MCOrgFragment(const MCExpr &Offset, int8_t Value, SMLoc Loc)
Instances of this class represent a uniqued identifier for a section in the current translation unit.
void setAlignment(Align Value)
unsigned getOrdinal() const
void ensureMinAlignment(Align MinAlignment)
Makes sure that Alignment is at least MinAlignment.
bool isBssSection() const
Check whether this section is "virtual", that is has no actual object file contents.
unsigned getLastSubsection() const
bool isLinkerRelaxable() const
static constexpr unsigned NonUniqueID
const MCSymbol * getBeginSymbol() const
bool hasInstructions() const
bool isRegistered() const
void setHasInstructions(bool Value)
void setBeginSymbol(MCSymbol *Sym)
MCSection(const MCSection &)=delete
void setOrdinal(unsigned Value)
MCSection & operator=(const MCSection &)=delete
StringRef getName() const
MCFragment & getDummyFragment()
unsigned firstLinkerRelaxable() const
FragList * curFragList() const
MCSymbol * getBeginSymbol()
MCSection(StringRef Name, bool IsText, bool IsBss, MCSymbol *Begin)
void setIsRegistered(bool Value)
void setFirstLinkerRelaxable(unsigned Order)
Generic base class for all target subtargets.
const MCSymbol * getSymbol() const
MCSymbolIdFragment(const MCSymbol *Sym)
static bool classof(const MCFragment *F)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Represent a mutable reference to an array (0 or more elements consecutively in memory),...
MutableArrayRef< T > slice(size_t N, size_t M) const
Chop off the first N elements of the array, and keep M elements in the array.
Represents a location in source code.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
LLVM Value Representation.
Calculates the starting offsets for various sections within the .debug_names section.
This is an optimization pass for GlobalISel generic memory operations.
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
MutableArrayRef(T &OneElt) -> MutableArrayRef< T >
ArrayRef(const T &OneElt) -> ArrayRef< T >
OutputIt copy(R &&Range, OutputIt Out)
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Next
@ End
Run the machine verifier once, at the end of the pipeline.
This struct is a compact representation of a valid (non-zero power of two) alignment.
MCFragment & operator*() const
bool operator==(const iterator &O) const
bool operator!=(const iterator &O) const