48 #define DEBUG_TYPE "assembler" 53 STATISTIC(EmittedFragments,
"Number of emitted assembler fragments - total");
55 "Number of emitted assembler fragments - relaxable");
57 "Number of emitted assembler fragments - data");
58 STATISTIC(EmittedCompactEncodedInstFragments,
59 "Number of emitted assembler fragments - compact encoded inst");
61 "Number of emitted assembler fragments - align");
63 "Number of emitted assembler fragments - fill");
65 "Number of emitted assembler fragments - org");
66 STATISTIC(evaluateFixup,
"Number of evaluated fixups");
67 STATISTIC(FragmentLayouts,
"Number of fragment layouts");
68 STATISTIC(ObjectBytes,
"Number of emitted object file bytes");
69 STATISTIC(RelaxationSteps,
"Number of assembler layout and relaxation steps");
70 STATISTIC(RelaxedInstructions,
"Number of relaxed instructions");
72 "Number of Padding Fragments relaxations");
74 "Total size of all padding from adding Fragments");
87 std::unique_ptr<MCAsmBackend> Backend,
88 std::unique_ptr<MCCodeEmitter> Emitter,
89 std::unique_ptr<MCObjectWriter> Writer)
90 : Context(Context), Backend(
std::move(Backend)),
91 Emitter(
std::move(Emitter)), Writer(
std::move(Writer)),
92 BundleAlignSize(0), RelaxAll(
false), SubsectionsViaSymbols(
false),
93 IncrementalLinkerCompatible(
false), ELFHeaderEFlags(0) {
94 VersionInfo.Major = 0;
102 IndirectSymbols.clear();
104 LinkerOptions.clear();
109 SubsectionsViaSymbols =
false;
110 IncrementalLinkerCompatible =
false;
112 LOHContainer.
reset();
113 VersionInfo.Major = 0;
129 Sections.push_back(&Section);
135 if (ThumbFuncs.count(Symbol))
161 ThumbFuncs.insert(Symbol);
199 bool MCAssembler::evaluateFixup(
const MCAsmLayout &Layout,
202 bool &WasForced)
const {
203 ++stats::evaluateFixup;
222 "unsupported subtraction of qualified symbol");
231 bool IsResolved =
false;
235 }
else if (!Target.
getSymA()) {
243 IsResolved = Writer->isSymbolRefDifferenceFullyResolvedImpl(
244 *
this, SA, *DF,
false,
true);
254 const MCSymbol &Sym = A->getSymbol();
266 assert((ShouldAlignPC ? IsPCRel :
true) &&
267 "FKF_IsAlignedDownTo32Bits is only allowed on PC-relative fixups!");
274 if (ShouldAlignPC) Offset &= ~0x3;
279 if (IsResolved &&
getBackend().shouldForceRelocation(*
this, Fixup, Target)) {
292 return cast<MCDataFragment>(
F).getContents().size();
294 return cast<MCRelaxableFragment>(
F).getContents().size();
296 return cast<MCCompactEncodedInstFragment>(
F).getContents().size();
298 auto &FF = cast<MCFillFragment>(
F);
299 int64_t NumValues = 0;
300 if (!FF.getNumValues().evaluateAsAbsolute(NumValues, Layout)) {
302 "expected assembly-time absolute expression");
305 int64_t
Size = NumValues * FF.getValueSize();
314 return cast<MCLEBFragment>(
F).getContents().size();
317 return cast<MCPaddingFragment>(
F).getSize();
342 "expected assembly-time absolute expression");
347 int64_t TargetLocation = Value.getConstant();
354 TargetLocation += Val;
356 int64_t
Size = TargetLocation - FragmentOffset;
357 if (Size < 0 || Size >= 0x40000000) {
359 OF.
getLoc(),
"invalid .org offset '" +
Twine(TargetLocation) +
360 "' (at offset '" +
Twine(FragmentOffset) +
"')");
367 return cast<MCDwarfLineAddrFragment>(
F).getContents().size();
369 return cast<MCDwarfCallFrameFragment>(
F).getContents().size();
371 return cast<MCCVInlineLineTableFragment>(
F).getContents().size();
373 return cast<MCCVDefRangeFragment>(
F).getContents().size();
385 assert(!isFragmentValid(F) &&
"Attempt to recompute a valid fragment!");
388 assert((!Prev || isFragmentValid(Prev)) &&
389 "Attempt to compute fragment before its predecessor!");
391 ++stats::FragmentLayouts;
395 F->Offset = Prev->Offset + getAssembler().computeFragmentSize(*
this, *Prev);
428 assert(isa<MCEncodedFragment>(F) &&
429 "Only MCEncodedFragment implementations have instructions");
431 uint64_t FSize = Assembler.computeFragmentSize(*
this, *EF);
433 if (!Assembler.getRelaxAll() && FSize > Assembler.getBundleAlignSize())
436 uint64_t RequiredBundlePadding =
438 if (RequiredBundlePadding > UINT8_MAX)
441 EF->Offset += RequiredBundlePadding;
451 Symbols.push_back(&Symbol);
457 uint64_t FSize)
const {
461 if (BundlePadding > 0) {
463 "Writing bundle padding with disabled bundling");
465 "Writing bundle padding for a fragment without instructions");
467 unsigned TotalLength = BundlePadding +
static_cast<unsigned>(FSize);
478 if (!
getBackend().writeNopData(OS, DistanceToBoundary))
480 Twine(DistanceToBoundary) +
" bytes");
481 BundlePadding -= DistanceToBoundary;
483 if (!
getBackend().writeNopData(OS, BundlePadding))
485 Twine(BundlePadding) +
" bytes");
502 uint64_t Start = OS.
tell();
505 ++stats::EmittedFragments;
509 ++stats::EmittedAlignFragments;
521 "' is not a divisor of padding size '" +
522 Twine(FragmentSize) +
"'");
531 Twine(Count) +
" bytes");
536 for (uint64_t i = 0; i != Count; ++i) {
541 support::endian::write<uint16_t>(OS, AF.
getValue(), Endian);
544 support::endian::write<uint32_t>(OS, AF.
getValue(), Endian);
547 support::endian::write<uint64_t>(OS, AF.
getValue(), Endian);
555 ++stats::EmittedDataFragments;
556 OS << cast<MCDataFragment>(
F).getContents();
560 ++stats::EmittedRelaxableFragments;
561 OS << cast<MCRelaxableFragment>(
F).getContents();
565 ++stats::EmittedCompactEncodedInstFragments;
566 OS << cast<MCCompactEncodedInstFragment>(
F).getContents();
570 ++stats::EmittedFillFragments;
574 const unsigned MaxChunkSize = 16;
575 char Data[MaxChunkSize];
578 for (
unsigned I = 0;
I != VSize; ++
I) {
580 Data[
I] = uint8_t(V >> (index * 8));
582 for (
unsigned I = VSize;
I < MaxChunkSize; ++
I)
583 Data[
I] = Data[
I - VSize];
586 const unsigned NumPerChunk = MaxChunkSize / VSize;
588 const unsigned ChunkSize = VSize * NumPerChunk;
592 for (uint64_t
I = 0,
E = FragmentSize / ChunkSize;
I !=
E; ++
I)
596 unsigned TrailingCount = FragmentSize % ChunkSize;
598 OS.
write(Data, TrailingCount);
611 Twine(FragmentSize) +
" bytes");
622 ++stats::EmittedOrgFragments;
625 for (uint64_t i = 0, e = FragmentSize; i != e; ++i)
642 const auto &OF = cast<MCCVInlineLineTableFragment>(
F);
643 OS << OF.getContents();
647 const auto &DRF = cast<MCCVDefRangeFragment>(
F);
648 OS << DRF.getContents();
656 "The stream should advance by fragment size");
669 switch (
F.getKind()) {
680 if (
auto *ELFSec = dyn_cast<const MCSectionELF>(Sec))
682 ELFSec->getSectionName() +
"'");
691 assert((cast<MCAlignFragment>(
F).getValueSize() == 0 ||
692 cast<MCAlignFragment>(
F).getValue() == 0) &&
693 "Invalid align in virtual section!");
696 assert((cast<MCFillFragment>(
F).getValue() == 0) &&
697 "Invalid fill in virtual section!");
705 uint64_t Start = OS.
tell();
714 std::tuple<MCValue, uint64_t, bool>
721 bool IsResolved = evaluateFixup(Layout, Fixup, &F, Target, FixedValue,
748 return std::make_tuple(Target, FixedValue, IsResolved);
754 errs() <<
"assembler backend - pre-layout\n--\n";
758 unsigned SectionIndex = 0;
769 for (
unsigned i = 0, e = Layout.
getSectionOrder().size(); i != e; ++i) {
773 unsigned FragmentIndex = 0;
775 Frag.setLayoutOrder(FragmentIndex++);
779 while (layoutOnce(Layout))
784 errs() <<
"assembler backend - post-relaxation\n--\n";
788 finishLayout(Layout);
791 errs() <<
"assembler backend - final-layout\n--\n";
805 if (isa<MCEncodedFragment>(&Frag) &&
806 isa<MCCompactEncodedInstFragment>(&Frag))
808 if (!isa<MCEncodedFragment>(&Frag) && !isa<MCCVDefRangeFragment>(&Frag))
813 if (
auto *FragWithFixups = dyn_cast<MCDataFragment>(&Frag)) {
814 Fixups = FragWithFixups->getFixups();
815 Contents = FragWithFixups->getContents();
816 STI = FragWithFixups->getSubtargetInfo();
817 assert(!FragWithFixups->hasInstructions() || STI !=
nullptr);
818 }
else if (
auto *FragWithFixups = dyn_cast<MCRelaxableFragment>(&Frag)) {
819 Fixups = FragWithFixups->getFixups();
820 Contents = FragWithFixups->getContents();
821 STI = FragWithFixups->getSubtargetInfo();
822 assert(!FragWithFixups->hasInstructions() || STI !=
nullptr);
823 }
else if (
auto *FragWithFixups = dyn_cast<MCCVDefRangeFragment>(&Frag)) {
824 Fixups = FragWithFixups->getFixups();
825 Contents = FragWithFixups->getContents();
826 }
else if (
auto *FragWithFixups = dyn_cast<MCDwarfLineAddrFragment>(&Frag)) {
827 Fixups = FragWithFixups->getFixups();
828 Contents = FragWithFixups->getContents();
831 for (
const MCFixup &Fixup : Fixups) {
835 std::tie(Target, FixedValue, IsResolved) =
836 handleFixup(Layout, Frag, Fixup);
853 bool MCAssembler::fixupNeedsRelaxation(
const MCFixup &Fixup,
860 bool Resolved = evaluateFixup(Layout, Fixup, DF, Target, Value, WasForced);
879 if (fixupNeedsRelaxation(Fixup, F, Layout))
885 bool MCAssembler::relaxInstruction(
MCAsmLayout &Layout,
888 "Expected CodeEmitter defined for relaxInstruction");
889 if (!fragmentNeedsRelaxation(&F, Layout))
892 ++stats::RelaxedInstructions;
919 bool MCAssembler::relaxPaddingFragment(
MCAsmLayout &Layout,
922 uint64_t OldSize = PF.
getSize();
925 uint64_t NewSize = PF.
getSize();
927 ++stats::PaddingFragmentsRelaxations;
928 stats::PaddingFragmentsBytes += NewSize;
929 stats::PaddingFragmentsBytes -= OldSize;
953 bool MCAssembler::relaxDwarfLineAddr(
MCAsmLayout &Layout,
959 if (
getBackend().requiresDiffExpressionRelocations())
960 Abs = DF.
getAddrDelta().evaluateAsAbsolute(AddrDelta, Layout);
963 assert(Abs &&
"We created a line delta with an invalid expression");
980 LineDelta, AddrDelta,
981 OSE, &Offset, &Size);
988 FixupExpr = ABE->
getLHS();
995 return OldSize != Data.
size();
998 bool MCAssembler::relaxDwarfCallFrameFragment(
MCAsmLayout &Layout,
1004 assert(Abs &&
"We created call frame with an invalid expression");
1010 return OldSize != Data.
size();
1013 bool MCAssembler::relaxCVInlineLineTable(
MCAsmLayout &Layout,
1020 bool MCAssembler::relaxCVDefRange(
MCAsmLayout &Layout,
1037 bool RelaxedFrag =
false;
1038 switch(
I->getKind()) {
1043 "Did not expect a MCRelaxableFragment in RelaxAll mode");
1044 RelaxedFrag = relaxInstruction(Layout, *cast<MCRelaxableFragment>(
I));
1047 RelaxedFrag = relaxDwarfLineAddr(Layout,
1048 *cast<MCDwarfLineAddrFragment>(
I));
1052 relaxDwarfCallFrameFragment(Layout,
1053 *cast<MCDwarfCallFrameFragment>(
I));
1056 RelaxedFrag = relaxLEB(Layout, *cast<MCLEBFragment>(
I));
1059 RelaxedFrag = relaxPaddingFragment(Layout, *cast<MCPaddingFragment>(
I));
1063 relaxCVInlineLineTable(Layout, *cast<MCCVInlineLineTableFragment>(
I));
1066 RelaxedFrag = relaxCVDefRange(Layout, *cast<MCCVDefRangeFragment>(
I));
1069 if (RelaxedFrag && !FirstRelaxedFragment)
1070 FirstRelaxedFragment = &*
I;
1072 if (FirstRelaxedFragment) {
1079 bool MCAssembler::layoutOnce(
MCAsmLayout &Layout) {
1080 ++stats::RelaxationSteps;
1082 bool WasRelaxed =
false;
1085 while (layoutSectionOnce(Layout, Sec))
1092 void MCAssembler::finishLayout(
MCAsmLayout &Layout) {
1095 for (
unsigned int i = 0, n = Layout.
getSectionOrder().size(); i != n; ++i) {
1103 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 1107 OS <<
"<MCAssembler\n";
1108 OS <<
" Sections:[\n ";
1110 if (it !=
begin()) OS <<
",\n ";
1120 OS <<
", Index:" << it->getIndex() <<
", ";
const MCAsmInfo * getAsmInfo() const
Instances of this class represent a uniqued identifier for a section in the current translation unit...
bool alignToBundleEnd() const
Should this fragment be placed at the end of an aligned bundle?
Fragment for adding required padding.
void encodeDefRange(MCAsmLayout &Layout, MCCVDefRangeFragment &F)
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
uint32_t getIndex() const
Get the (implementation defined) index.
static void writeFragment(raw_ostream &OS, const MCAssembler &Asm, const MCAsmLayout &Layout, const MCFragment &F)
Write the fragment F to the output file.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class represents lattice values for constants.
MCObjectWriter * getWriterPtr() const
bool isVariable() const
isVariable - Check if this is a variable symbol.
This represents an "assembler immediate".
const support::endianness Endian
uint64_t getSectionAddressSize(const MCSection *Sec) const
Get the address space size of the given section, as it effects layout.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
VariantKind getKind() const
virtual bool requiresDiffExpressionRelocations() const
Check whether the given target requires emitting differences of two symbols as a set of relocations...
virtual void relaxInstruction(const MCInst &Inst, const MCSubtargetInfo &STI, MCInst &Res) const =0
Relax the instruction in the given fragment to the next wider instruction.
uint8_t getValueSize() const
SmallString< 8 > & getContents()
void setLayoutOrder(unsigned Value)
static bool FixedEncode(MCContext &Context, MCDwarfLineTableParams Params, int64_t LineDelta, uint64_t AddrDelta, raw_ostream &OS, uint32_t *Offset, uint32_t *Size)
Utility function to encode a Dwarf pair of LineDelta and AddrDeltas using fixed length operands...
virtual const MCFixupKindInfo & getFixupKindInfo(MCFixupKind Kind) const
Get information on a fixup kind.
virtual void executePostLayoutBinding(MCAssembler &Asm, const MCAsmLayout &Layout)=0
Perform any late binding of symbols (for example, to assign symbol indices for use when generating re...
const MCExpr * getLHS() const
Get the left-hand side expression of the binary operator.
bool isAbsolute() const
Is this an absolute (as opposed to relocatable) value.
A raw_ostream that writes to an SmallVector or SmallString.
void registerSymbol(const MCSymbol &Symbol, bool *Created=nullptr)
static MCFixupKind getKindForSize(unsigned Size, bool isPCRel)
Return the generic fixup kind for a value with the given size.
FragmentType getKind() const
STATISTIC(NumFunctions, "Total number of functions")
const MCExpr & getOffset() const
bool isBundlingEnabled() const
static void Encode(MCContext &Context, MCDwarfLineTableParams Params, int64_t LineDelta, uint64_t AddrDelta, raw_ostream &OS)
Utility function to encode a Dwarf pair of LineDelta and AddrDeltas.
symbol_iterator symbol_begin()
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
unsigned getBundleAlignSize() const
Is this fixup kind PCrelative? This is used by the assembler backend to evaluate fixup values in a ta...
#define DEBUG_WITH_TYPE(TYPE, X)
DEBUG_WITH_TYPE macro - This macro should be used by passes to emit debug information.
MCContext & getContext() const
int64_t getConstant() const
const MCSymbolRefExpr * getSymB() const
Interface implemented by fragments that contain encoded instructions and/or data. ...
fixup_iterator fixup_end()
virtual uint64_t writeObject(MCAssembler &Asm, const MCAsmLayout &Layout)=0
Write the object file and returns the number of bytes written.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
MCDwarfLineTableParams getDWARFLinetableParams() const
Encapsulates the layout of an assembly file at a particular point in time.
bool isSymbolLinkerVisible(const MCSymbol &SD) const
Check whether a particular symbol is visible to the linker and is required in the symbol table...
MCCodeEmitter & getEmitter() const
virtual void encodeInstruction(const MCInst &Inst, raw_ostream &OS, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const =0
EncodeInstruction - Encode the given Inst to bytes on the output stream OS.
Base class for the full range of assembler expressions which are needed for parsing.
bool isInSection() const
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute)...
bool registerSection(MCSection &Section)
The access may reference the value stored in memory.
static MCFixup createSubFor(const MCFixup &Fixup)
Return a fixup corresponding to the sub half of a add/sub fixup pair for the given Fixup...
Represent a reference to a symbol from inside an expression.
MCObjectWriter & getWriter() const
virtual bool fixupNeedsRelaxationAdvanced(const MCFixup &Fixup, bool Resolved, uint64_t Value, const MCRelaxableFragment *DF, const MCAsmLayout &Layout, const bool WasForced) const
Target specific predicate for whether a given fixup requires the associated instruction to be relaxed...
Context object for machine code objects.
const MCExpr & getAddrDelta() const
bool evaluateAsRelocatable(MCValue &Res, const MCAsmLayout *Layout, const MCFixup *Fixup) const
Try to evaluate the expression to a relocatable value, i.e.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
const MCExpr & getAddrDelta() const
reverse_iterator rbegin()
MCAssembler & getAssembler() const
Get the assembler object this is a layout for.
void layoutFragment(MCFragment *Fragment)
Perform layout for a single fragment, assuming that the previous fragment has already been laid out c...
SmallVectorImpl< char > & getContents()
Instances of this class represent a single low-level machine instruction.
virtual unsigned getMinimumNopSize() const
Returns the minimum size of a nop in bytes on this target.
uint8_t getBundlePadding() const
Get the padding size that must be inserted before this fragment.
void encodeInlineLineTable(MCAsmLayout &Layout, MCCVInlineLineTableFragment &F)
Encodes the binary annotations once we have a layout.
A relaxable fragment holds on to its MCInst, since it may need to be relaxed during the assembler lay...
virtual bool writeNopData(raw_ostream &OS, uint64_t Count) const =0
Write an (optimal) nop sequence of Count bytes to the given output.
bool evaluateKnownAbsolute(int64_t &Res, const MCAsmLayout &Layout) const
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
virtual void reset()
Lifetime management.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
void invalidateFragmentsFrom(MCFragment *F)
Invalidate the fragments starting with F because it has been resized.
virtual void reset()
lifetime management
bool isRegistered() const
SmallVectorImpl< MCFixup > & getFixups()
bool getSymbolOffset(const MCSymbol &S, uint64_t &Val) const
Get the offset of the given symbol, as computed in the current layout.
virtual bool isSectionAtomizableBySymbols(const MCSection &Section) const
True if the section is atomized using the symbols in it.
const MCSymbol * getAtom(const MCSymbol &S) const
Find the symbol which defines the atom containing the given symbol, or null if there is no such symbo...
bool isTemporary() const
isTemporary - Check if this is an assembler temporary symbol.
const MCSymbolRefExpr * getSymA() const
void reportError(SMLoc L, const Twine &Msg)
Should this fixup kind force a 4-byte aligned effective PC value?
const MCSymbol * getAtom() const
llvm::SmallVectorImpl< MCSection * > & getSectionOrder()
void setIsRegistered(bool Value)
uint32_t getOffset() const
void writeSectionData(raw_ostream &OS, const MCSection *Section, const MCAsmLayout &Layout) const
Emit the section contents to OS.
Binary assembler expressions.
static MCFixup create(uint32_t Offset, const MCExpr *Value, MCFixupKind Kind, SMLoc Loc=SMLoc())
Fragment representing the .cv_def_range directive.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
raw_ostream & write(unsigned char C)
void layout(MCAsmLayout &Layout)
const MCExpr & getValue() const
uint64_t getFragmentOffset(const MCFragment *F) const
Get the offset of the given fragment inside its containing section.
PowerPC TLS Dynamic Call Fixup
void setOrdinal(unsigned Value)
Iterator for intrusive lists based on ilist_node.
unsigned getMaxBytesToEmit() const
MCAsmBackend * getBackendPtr() const
void writeFragmentPadding(raw_ostream &OS, const MCEncodedFragment &F, uint64_t FSize) const
Write the necessary bundle padding to OS.
MCAssembler(MCContext &Context, std::unique_ptr< MCAsmBackend > Backend, std::unique_ptr< MCCodeEmitter > Emitter, std::unique_ptr< MCObjectWriter > Writer)
Construct a new assembler instance.
virtual bool isVirtualSection() const =0
Check whether this section is "virtual", that is has no actual object file contents.
MCAsmBackend & getBackend() const
unsigned encodeULEB128(uint64_t Value, raw_ostream &OS, unsigned PadTo=0)
Utility function to encode a ULEB128 value to an output stream.
const MCSymbol & getSymbol() const
bool isUndefined(bool SetUsed=true) const
isUndefined - Check if this symbol undefined (i.e., implicitly defined).
MCFragment * getFragment(bool SetUsed=true) const
unsigned encodeSLEB128(int64_t Value, raw_ostream &OS, unsigned PadTo=0)
Utility function to encode a SLEB128 value to an output stream.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
bool isRegistered() const
Represents a symbol table index fragment.
An iterator type that allows iterating over the pointees via some other iterator. ...
virtual void recordRelocation(MCAssembler &Asm, const MCAsmLayout &Layout, const MCFragment *Fragment, const MCFixup &Fixup, MCValue Target, uint64_t &FixedValue)=0
Record a relocation entry.
static void EncodeAdvanceLoc(MCContext &Context, uint64_t AddrDelta, raw_ostream &OS)
MCLOHContainer & getLOHContainer()
void setBundlePadding(uint8_t N)
Set the padding size for this fragment.
uint64_t computeBundlePadding(const MCAssembler &Assembler, const MCEncodedFragment *F, uint64_t FOffset, uint64_t FSize)
Compute the amount of padding required before the fragment F to obey bundling restrictions, where FOffset is the fragment's offset in its section and FSize is the fragment's size.
bool isDefined() const
isDefined - Check if this symbol is defined (i.e., it has an address).
Target - Wrapper for Target specific information.
bool isThumbFunc(const MCSymbol *Func) const
Check whether a given symbol has been flagged with .thumb_func.
MCSection * getParent() const
uint64_t getValue() const
bool hasInstructions() const
Does this fragment have instructions emitted into it? By default this is false, but specific fragment...
const MCSubtargetInfo * getSubtargetInfo() const
Retrieve the MCSubTargetInfo in effect when the instruction was encoded.
SmallString< 8 > & getContents()
void setIsRegistered(bool Value) const
Fragment representing the binary annotations produced by the .cv_inline_linetable directive...
bool isUsedInReloc() const
unsigned getValueSize() const
unsigned getAlignment() const
Represents a version number in the form major[.minor[.subminor[.build]]].
int64_t getLineDelta() const
const MCInst & getInst() const
static MCFixup createAddFor(const MCFixup &Fixup)
Return a fixup corresponding to the add half of a add/sub fixup pair for the given Fixup...
static MCValue get(const MCSymbolRefExpr *SymA, const MCSymbolRefExpr *SymB=nullptr, int64_t Val=0, uint32_t RefKind=0)
fixup_iterator fixup_begin()
Generic base class for all target subtargets.
bool evaluateAsValue(MCValue &Res, const MCAsmLayout &Layout) const
Try to evaluate the expression to the form (a - b + constant) where neither a nor b are variables...
uint64_t computeFragmentSize(const MCAsmLayout &Layout, const MCFragment &F) const
Compute the effective fragment size assuming it is laid out at the given SectionAddress and FragmentO...
SmallString< 8 > & getContents()
const MCSymbol * getSymbol()
uint32_t getRefKind() const
CodeViewContext & getCVContext()
void reset()
Reuse an assembler instance.
Fragment for data and encoded instructions.
uint64_t getSectionFileSize(const MCSection *Sec) const
Get the data size of the given section, as emitted to the object file.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const MCExpr * getVariableValue(bool SetUsed=true) const
getVariableValue - Get the value for variable symbols.
LLVM Value Representation.
uint64_t OffsetToAlignment(uint64_t Value, uint64_t Align)
Returns the offset to the next integer (mod 2**64) that is greater than or equal to Value and is a mu...
uint64_t tell() const
tell - Return the current offset with the file.
This class implements an extremely fast bulk output stream that can only output to a stream...
const MCExpr * getValue() const
StringRef - Represent a constant reference to a string, i.e.
virtual void reset()
lifetime management
void Finish()
Finish - Do final processing and write the object to the output stream.
MCSection::FragmentListType & getFragmentList()
virtual void applyFixup(const MCAssembler &Asm, const MCFixup &Fixup, const MCValue &Target, MutableArrayRef< char > Data, uint64_t Value, bool IsResolved, const MCSubtargetInfo *STI) const =0
Apply the Value for given Fixup into the provided data fragment, at the offset specified by the fixup...
virtual void finishLayout(MCAssembler const &Asm, MCAsmLayout &Layout) const
Give backend an opportunity to finish layout after relaxation.
void setInst(const MCInst &Value)
MCCodeEmitter * getEmitterPtr() const
MCFixupKind getKind() const
symbol_iterator symbol_end()