47#define DEBUG_TYPE "assembler"
52STATISTIC(EmittedFragments,
"Number of emitted assembler fragments - total");
54 "Number of emitted assembler fragments - relaxable");
56 "Number of emitted assembler fragments - data");
58 "Number of emitted assembler fragments - align");
60 "Number of emitted assembler fragments - fill");
61STATISTIC(EmittedNopsFragments,
"Number of emitted assembler fragments - nops");
62STATISTIC(EmittedOrgFragments,
"Number of emitted assembler fragments - org");
64STATISTIC(FixupEvalForRelax,
"Number of fixup evaluations for relaxation");
65STATISTIC(ObjectBytes,
"Number of emitted object file bytes");
66STATISTIC(RelaxationSteps,
"Number of assembler layout and relaxation steps");
67STATISTIC(RelaxedInstructions,
"Number of relaxed instructions");
80 std::unique_ptr<MCAsmBackend> Backend,
81 std::unique_ptr<MCCodeEmitter> Emitter,
82 std::unique_ptr<MCObjectWriter> Writer)
83 : Context(Context), Backend(
std::
move(Backend)),
86 this->Backend->setAssembler(
this);
88 this->Writer->setAssembler(
this);
93 HasFinalLayout =
false;
110 if (Section.isRegistered())
112 Sections.push_back(&Section);
113 Section.setIsRegistered(
true);
118 if (ThumbFuncs.count(Symbol))
121 if (!Symbol->isVariable())
124 const MCExpr *Expr = Symbol->getVariableValue();
130 if (V.getSubSym() || V.getSpecifier())
134 if (!Sym || V.getSpecifier())
140 ThumbFuncs.insert(Symbol);
163 bool IsResolved =
false;
170 if (
Add &&
Add->isDefined())
172 if (
Sub &&
Sub->isDefined())
175 if (
Fixup.isPCRel()) {
182 "Stretch should only be applied during relaxation");
183 MCFragment *AF =
Add ?
Add->getFragment() :
nullptr;
186 MCFragment *SF =
Sub ?
Sub->getFragment() :
nullptr;
190 if (
Add && !
Sub && !
Add->isUndefined() && !
Add->isAbsolute()) {
192 *
Add,
F,
false,
true);
195 IsResolved =
Target.isAbsolute();
210 switch (
F.getKind()) {
223 int64_t NumValues = 0;
224 if (!FF.getNumValues().evaluateKnownAbsolute(NumValues, *
this)) {
225 recordError(FF.getLoc(),
"expected assembly-time absolute expression");
228 int64_t
Size = NumValues * FF.getValueSize();
230 recordError(FF.getLoc(),
"invalid number of bytes");
251 if (!OF.getOffset().evaluateAsValue(
Value, *
this)) {
252 recordError(OF.getLoc(),
"expected assembly-time absolute expression");
257 int64_t TargetLocation =
Value.getConstant();
258 if (
const auto *SA =
Value.getAddSym()) {
261 recordError(OF.getLoc(),
"expected absolute expression");
264 TargetLocation += Val;
266 int64_t
Size = TargetLocation - FragmentOffset;
269 "' (at offset '" +
Twine(FragmentOffset) +
342 if (!Symbol.isVariable())
345 const MCExpr *Expr = Symbol.getVariableValue();
356 "' could not be evaluated in a subtraction expression");
367 "' cannot be used in assignment expr");
388 bool Changed = !Symbol.isRegistered();
390 Symbol.setIsRegistered(
true);
391 Symbols.push_back(&Symbol);
397 relocDirectives.push_back(RD);
408 if (Asm.isBundlingEnabled()) {
409 uint64_t BundleSize = Asm.getBundleAlign().value();
413 if (!Asm.getBackend().writeNopData(OS,
Size, STI))
425 uint64_t FragmentSize = Asm.computeFragmentSize(
F);
434 ++stats::EmittedFragments;
436 switch (
F.getKind()) {
446 ++stats::EmittedDataFragments;
448 ++stats::EmittedRelaxableFragments;
450 OS <<
StringRef(EF.getContents().data(), EF.getContents().size());
451 OS <<
StringRef(EF.getVarContents().data(), EF.getVarContents().size());
455 ++stats::EmittedAlignFragments;
456 OS <<
StringRef(
F.getContents().data(),
F.getContents().size());
458 "Invalid virtual align in concrete fragment!");
460 uint64_t Count = (FragmentSize -
F.getFixedSize()) /
F.getAlignFillLen();
461 assert((FragmentSize -
F.getFixedSize()) %
F.getAlignFillLen() == 0 &&
462 "computeFragmentSize computed size is incorrect");
465 if (
F.hasAlignEmitNops()) {
467 Asm.getFragmentOffset(
F) +
F.getFixedSize(),
Count,
468 F.getSubtargetInfo());
472 switch (
F.getAlignFillLen()) {
476 OS <<
char(
F.getAlignFill());
493 OS <<
StringRef(
F.getContents().data(),
F.getContents().size());
494 uint64_t PadSize = FragmentSize -
F.getContents().size();
495 if (
F.getPrefAlignEmitNops()) {
496 if (!Asm.getBackend().writeNopData(OS, PadSize,
F.getSubtargetInfo()))
498 Twine(PadSize) +
" bytes");
499 }
else if (
F.getPrefAlignFill() == 0) {
502 char B =
char(
F.getPrefAlignFill());
510 ++stats::EmittedFillFragments;
514 const unsigned MaxChunkSize = 16;
515 char Data[MaxChunkSize];
516 assert(0 < VSize && VSize <= MaxChunkSize &&
"Illegal fragment fill size");
519 for (
unsigned I = 0;
I != VSize; ++
I) {
523 for (
unsigned I = VSize;
I < MaxChunkSize; ++
I)
527 const unsigned NumPerChunk = MaxChunkSize / VSize;
529 const unsigned ChunkSize = VSize * NumPerChunk;
533 for (
uint64_t I = 0,
E = FragmentSize / ChunkSize;
I !=
E; ++
I)
537 unsigned TrailingCount = FragmentSize % ChunkSize;
544 ++stats::EmittedNopsFragments;
549 int64_t MaximumNopLength =
552 assert(NumBytes > 0 &&
"Expected positive NOPs fragment size");
553 assert(ControlledNopLength >= 0 &&
"Expected non-negative NOP size");
555 if (ControlledNopLength > MaximumNopLength) {
556 Asm.reportError(NF.
getLoc(),
"illegal NOP size " +
557 std::to_string(ControlledNopLength) +
558 ". (expected within [0, " +
559 std::to_string(MaximumNopLength) +
"])");
562 ControlledNopLength = MaximumNopLength;
566 if (!ControlledNopLength)
567 ControlledNopLength = MaximumNopLength;
588 ++stats::EmittedOrgFragments;
591 for (
uint64_t i = 0, e = FragmentSize; i != e; ++i)
592 OS <<
char(OF.getValue());
600 "The stream should advance by fragment size");
613 auto Fn = [](
char c) {
return c != 0; };
615 bool HasNonZero =
false;
616 switch (
F.getKind()) {
619 "' contains invalid fragment");
629 assert(
F.getAlignFill() == 0 &&
"Invalid align in virtual section!");
632 assert(!
F.getPrefAlignEmitNops() &&
F.getPrefAlignFill() == 0 &&
633 "Invalid align in BSS");
644 "' cannot have non-zero bytes");
647 if (
F.getFixups().size() ||
F.getVarFixups().size()) {
649 "BSS section '" + Sec->getName() +
"' cannot have fixups");
671 errs() <<
"assembler backend - pre-layout\n--\n";
676 unsigned SectionIndex = 0;
681 if (Sec.Subsections.size() > 1) {
684 for (
auto &[
_,
List] : Sec.Subsections) {
686 Tail->Next =
List.Head;
689 Sec.Subsections.clear();
690 Sec.Subsections.push_back({0u, {Dummy.
getNext(), Tail}});
691 Sec.CurFragList = &Sec.Subsections[0].second;
693 unsigned FragmentIndex = 0;
695 Frag.setLayoutOrder(FragmentIndex++);
700 this->HasLayout =
true;
703 unsigned FirstStable = Sections.size();
704 while ((FirstStable = relaxOnce(FirstStable)) > 0)
717 errs() <<
"assembler backend - final-layout\n--\n";
726 this->HasFinalLayout =
true;
736 auto DrainRelocGroup = [](
MCFragment *
F, std::vector<MCFixup> &Group) {
737 F->insertRelocFixups(Group);
742 for (
auto &PF : relocDirectives) {
745 if (!O.evaluateAsValue(Res, *
this)) {
750 auto *
F = Sym ? Sym->getFragment() :
nullptr;
751 auto *Sec =
F ?
F->getParent() :
nullptr;
754 ".reloc offset is not relative to a section");
760 auto &Group = RelocGroups[
F];
761 if (!Group.empty() && Group[0].getOffset() <
Offset)
762 DrainRelocGroup(
F, Group);
763 Group.push_back(
Fixup);
766 for (
auto &[
F, Group] : RelocGroups)
767 DrainRelocGroup(
F, Group);
773 auto Contents =
F.getContents();
778 Fixup.getOffset() <=
F.getFixedSize());
780 reinterpret_cast<uint8_t *
>(Contents.data() +
Fixup.getOffset());
790 (
Fixup.getOffset() >=
F.getFixedSize() &&
791 Fixup.getOffset() <=
F.getSize()));
793 F.getVarContents().
data() + (
Fixup.getOffset() -
F.getFixedSize()));
811 assert(PendingErrors.empty());
817 bool AlignFixup =
false;
818 if (
F.hasAlignEmitNops()) {
822 Size +=
F.getAlignment().value();
824 if (!AlignFixup &&
Size >
F.getAlignMaxBytesToEmit())
826 F.VarContentStart =
F.getFixedSize();
827 F.VarContentEnd =
F.VarContentStart +
Size;
828 if (
F.VarContentEnd >
F.getParent()->ContentStorage.size())
829 F.getParent()->ContentStorage.resize(
F.VarContentEnd);
835 uint64_t RawStart =
F.Offset +
F.getFixedSize();
836 const MCSymbol &End =
F.getPrefAlignEnd();
839 "' must be in the current section");
846 for (
auto *Cur =
F.getNext(); Cur != EndFrag; Cur = Cur->getNext())
853 NewAlign = std::max(NewAlign,
F.getPrefAlignComputed());
854 F.setPrefAlignComputed(NewAlign);
856 F.VarContentStart =
F.getFixedSize();
857 F.VarContentEnd =
F.VarContentStart + NewPadSize;
858 if (
F.VarContentEnd >
F.getParent()->ContentStorage.size())
859 F.getParent()->ContentStorage.resize(
F.VarContentEnd);
862 F.getParent()->ensureMinAlignment(NewAlign);
865bool MCAssembler::fixupNeedsRelaxation(
const MCFragment &
F,
867 ++stats::FixupEvalForRelax;
878 "Expected CodeEmitter defined for relaxInstruction");
882 if (!
getBackend().mayNeedRelaxation(
F.getOpcode(),
F.getOperands(),
883 *
F.getSubtargetInfo()))
886 bool DoRelax =
false;
887 for (
const MCFixup &
Fixup :
F.getVarFixups())
888 if ((DoRelax = fixupNeedsRelaxation(
F,
Fixup)))
893 ++stats::RelaxedInstructions;
905 F.setVarContents(
Data);
906 F.setVarFixups(Fixups);
910 unsigned PadTo =
F.getVarSize();
917 ?
F.getLEBValue().evaluateKnownAbsolute(
Value, *
this)
918 :
F.getLEBValue().evaluateAsAbsolute(
Value, *
this);
924 Twine(
F.isLEBSigned() ?
".s" :
".u") +
925 "leb128 expression is not absolute");
943 F.setVarContents({
reinterpret_cast<char *
>(
Data),
Size});
953 Align BoundaryAlignment) {
955 return (StartAddr >>
Log2(BoundaryAlignment)) !=
956 ((EndAddr - 1) >>
Log2(BoundaryAlignment));
966 Align BoundaryAlignment) {
968 return (EndAddr & (BoundaryAlignment.
value() - 1)) == 0;
978 Align BoundaryAlignment) {
989 uint64_t AlignedOffset = Asm.getFragmentOffset(BF);
992 AlignedSize += Asm.computeFragmentSize(*
F);
999 if (!Asm.isBundlingEnabled())
1000 return needPadding(AlignedOffset, AlignedSize, BoundaryAlignment)
1024void MCAssembler::relaxDwarfLineAddr(
MCFragment &
F) {
1030 bool Abs =
F.getDwarfAddrDelta().evaluateKnownAbsolute(AddrDelta, *
this);
1031 assert(Abs &&
"We created a line delta with an invalid expression");
1033 SmallVector<char, 8>
Data;
1035 F.getDwarfLineDelta(), AddrDelta,
Data);
1036 F.setVarContents(
Data);
1040void MCAssembler::relaxDwarfCallFrameFragment(
MCFragment &
F) {
1046 bool Abs =
F.getDwarfAddrDelta().evaluateAsAbsolute(
Value, *
this);
1049 "invalid CFI advance_loc expression");
1054 SmallVector<char, 8>
Data;
1056 F.setVarContents(
Data);
1060void MCAssembler::relaxSFrameFragment(
MCFragment &
F) {
1064 bool Abs =
F.getSFrameAddrDelta().evaluateAsAbsolute(
Value, *
this);
1066 C.reportError(
F.getSFrameAddrDelta().getLoc(),
1067 "invalid CFI advance_loc expression in sframe");
1074 F.setVarContents(
Data);
1079 switch (
F.getKind()) {
1089 "Did not expect a FT_Relaxable in RelaxAll mode");
1090 relaxInstruction(
F);
1096 relaxDwarfLineAddr(
F);
1099 relaxDwarfCallFrameFragment(
F);
1102 relaxSFrameFragment(
F);
1105 relaxBoundaryAlign(
static_cast<MCBoundaryAlignFragment &
>(
F));
1112 *
this,
static_cast<MCCVInlineLineTableFragment &
>(
F));
1116 *
this,
static_cast<MCCVDefRangeFragment &
>(
F));
1121void MCAssembler::layoutSection(
MCSection &Sec) {
1123 for (MCFragment &
F : Sec) {
1134unsigned MCAssembler::relaxOnce(
unsigned FirstStable) {
1135 uint64_t MaxIterations = 0;
1136 PendingErrors.clear();
1138 for (
unsigned I = 0;
I != FirstStable; ++
I) {
1139 auto &Sec = *Sections[
I];
1144 for (MCFragment &
F : Sec) {
1159 FirstStable = Sections.size();
1163 if (Iters > Sec.curFragList()->Tail->getLayoutOrder())
1166 MaxIterations = std::max(MaxIterations, Iters);
1168 stats::RelaxationSteps += MaxIterations;
1180 PendingErrors.emplace_back(
Loc,
Msg.str());
1184 for (
auto &Err : PendingErrors)
1186 PendingErrors.clear();
1189#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
1197 if (!Sym.isVariable())
1198 if (
auto *
F = Sym.getFragment())
1199 FragToSyms.
try_emplace(
F).first->second.push_back(&Sym);
1204 Sec.
dump(&FragToSyms);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ShadowStackGC > C("shadow-stack", "Very portable GC for uncooperative code generators")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
static void writeControlledNops(raw_ostream &OS, const MCAssembler &Asm, uint64_t NumBytes, uint64_t Offset, uint64_t MaxNopSize, const MCSubtargetInfo *STI)
Write NumBytes of NOPs at Offset in chunks of at most MaxNopSize.
static bool getSymbolOffsetImpl(const MCAssembler &Asm, const MCSymbol &S, bool ReportError, uint64_t &Val)
static bool needPadding(uint64_t StartAddr, uint64_t Size, Align BoundaryAlignment)
Check if the branch needs padding.
static void writeFragment(raw_ostream &OS, const MCAssembler &Asm, const MCFragment &F)
Write the fragment F to the output file.
static bool mayCrossBoundary(uint64_t StartAddr, uint64_t Size, Align BoundaryAlignment)
Check if the branch crosses the boundary.
static bool isAgainstBoundary(uint64_t StartAddr, uint64_t Size, Align BoundaryAlignment)
Check if the branch is against the boundary.
static uint64_t computeBoundaryAlignSize(const MCAssembler &Asm, const MCBoundaryAlignFragment &BF)
Compute the padding size to boundary-align the fragments BF is responsible for.
static bool getLabelOffset(const MCAssembler &Asm, const MCSymbol &S, bool ReportError, uint64_t &Val)
PowerPC TLS Dynamic Call Fixup
This file defines the SmallVector class.
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
#define STATISTIC(VARNAME, DESC)
#define DEBUG_WITH_TYPE(TYPE,...)
DEBUG_WITH_TYPE macro - This macro should be used by passes to emit debug information.
LLVM_ABI void encodeInlineLineTable(const MCAssembler &Asm, MCCVInlineLineTableFragment &F)
Encodes the binary annotations once we have a layout.
LLVM_ABI void encodeDefRange(const MCAssembler &Asm, MCCVDefRangeFragment &F)
std::pair< iterator, bool > try_emplace(KeyT &&Key, Ts &&...Args)
virtual void relaxInstruction(MCInst &Inst, const MCSubtargetInfo &STI) const
Relax the instruction in the given fragment to the next wider instruction.
virtual bool relaxAlign(MCFragment &F, unsigned &Size)
virtual std::pair< bool, bool > relaxLEB128(MCFragment &, int64_t &Value) const
virtual bool fixupNeedsRelaxationAdvanced(const MCFragment &, const MCFixup &, const MCValue &, uint64_t, bool Resolved) const
Target specific predicate for whether a given fixup requires the associated instruction to be relaxed...
virtual void reset()
lifetime management
virtual void applyFixup(const MCFragment &, const MCFixup &, const MCValue &Target, uint8_t *Data, uint64_t Value, bool IsResolved)=0
MCContext & getContext() const
LLVM_ABI bool getSymbolOffset(const MCSymbol &S, uint64_t &Val) const
LLVM_ABI uint64_t getSectionAddressSize(const MCSection &Sec) const
LLVM_ABI void Finish()
Finish - Do final processing and write the object to the output stream.
bool isBundlingEnabled() const
LLVM_ABI void reportError(SMLoc L, const Twine &Msg) const
LLVM_ABI void writeSectionData(raw_ostream &OS, const MCSection *Section) const
Emit the section contents to OS.
iterator_range< pointee_iterator< SmallVector< const MCSymbol *, 0 >::const_iterator > > symbols() const
LLVM_ABI void dump() const
MCObjectWriter & getWriter() const
MCCodeEmitter * getEmitterPtr() const
LLVM_ABI void addRelocDirective(RelocDirective RD)
MCCodeEmitter & getEmitter() const
LLVM_ABI void recordError(SMLoc L, const Twine &Msg) const
LLVM_ABI MCAssembler(MCContext &Context, std::unique_ptr< MCAsmBackend > Backend, std::unique_ptr< MCCodeEmitter > Emitter, std::unique_ptr< MCObjectWriter > Writer)
Construct a new assembler instance.
LLVM_ABI bool isThumbFunc(const MCSymbol *Func) const
Check whether a given symbol has been flagged with .thumb_func.
MCAsmBackend & getBackend() const
LLVM_ABI bool registerSection(MCSection &Section)
LLVM_ABI void flushPendingErrors() const
LLVM_ABI uint64_t computeFragmentSize(const MCFragment &F) const
Compute the effective fragment size.
LLVM_ABI const MCSymbol * getBaseSymbol(const MCSymbol &Symbol) const
MCAsmBackend * getBackendPtr() const
LLVM_ABI uint64_t getSectionFileSize(const MCSection &Sec) const
LLVM_ABI void reset()
Reuse an assembler instance.
LLVM_ABI bool registerSymbol(const MCSymbol &Symbol)
uint64_t getFragmentOffset(const MCFragment &F) const
MCDwarfLineTableParams getDWARFLinetableParams() const
Represents required padding such that a particular other set of fragments does not cross a particular...
void setSize(uint64_t Value)
const MCFragment * getLastFragment() const
bool isAlignToEnd() const
Align getAlignment() const
virtual void encodeInstruction(const MCInst &Inst, SmallVectorImpl< char > &CB, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const =0
Encode the given Inst to bytes and append to CB.
virtual void reset()
Lifetime management.
static LLVM_ABI const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Context object for machine code objects.
LLVM_ABI CodeViewContext & getCVContext()
LLVM_ABI void reportError(SMLoc L, const Twine &Msg)
static LLVM_ABI void encodeAdvanceLoc(MCContext &Context, uint64_t AddrDelta, SmallVectorImpl< char > &OS)
static LLVM_ABI void encode(MCContext &Context, MCDwarfLineTableParams Params, int64_t LineDelta, uint64_t AddrDelta, SmallVectorImpl< char > &OS)
Utility function to encode a Dwarf pair of LineDelta and AddrDeltas.
Base class for the full range of assembler expressions which are needed for parsing.
LLVM_ABI bool evaluateAsValue(MCValue &Res, const MCAssembler &Asm) const
Try to evaluate the expression to the form (a - b + constant) where neither a nor b are variables.
LLVM_ABI bool evaluateAsRelocatable(MCValue &Res, const MCAssembler *Asm) const
Try to evaluate the expression to a relocatable value, i.e.
uint8_t getValueSize() const
uint64_t getValue() const
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
const MCExpr * getValue() const
LLVM_ABI SMLoc getLoc() const
static MCFixup create(uint32_t Offset, const MCExpr *Value, MCFixupKind Kind, bool PCRel=false)
Consider bit fields if we need more flags.
unsigned getLayoutOrder() const
MCSection * getParent() const
MCFragment * getNext() const
const MCSubtargetInfo * getSubtargetInfo() const
Retrieve the MCSubTargetInfo in effect when the instruction was encoded.
int64_t getControlledNopLength() const
int64_t getNumBytes() const
virtual bool isSymbolRefDifferenceFullyResolvedImpl(const MCSymbol &SymA, const MCFragment &FB, bool InSet, bool IsPCRel) const
bool getSubsectionsViaSymbols() const
virtual void executePostLayoutBinding()
Perform any late binding of symbols (for example, to assign symbol indices for use when generating re...
virtual uint64_t writeObject()=0
Write the object file and returns the number of bytes written.
static LLVM_ABI void encodeFuncOffset(MCContext &C, uint64_t Offset, SmallVectorImpl< char > &Out, MCFragment *FDEFrag)
Instances of this class represent a uniqued identifier for a section in the current translation unit.
bool isBssSection() const
Check whether this section is "virtual", that is has no actual object file contents.
void dump(DenseMap< const MCFragment *, SmallVector< const MCSymbol *, 0 > > *FragToSyms=nullptr) const
void setOrdinal(unsigned Value)
FragList * curFragList() const
Generic base class for all target subtargets.
Represents a symbol table index fragment.
const MCSymbol * getSymbol() const
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
bool isCommon() const
Is this a 'common' symbol.
StringRef getName() const
getName - Get the symbol name.
bool isVariable() const
isVariable - Check if this is a variable symbol.
uint32_t getIndex() const
Get the (implementation defined) index.
const MCExpr * getVariableValue() const
Get the expression of the variable symbol.
MCFragment * getFragment() const
uint64_t getOffset() const
const MCSymbol * getAddSym() const
int64_t getConstant() const
const MCSymbol * getSubSym() const
Represents a location in source code.
Represent a constant reference to a string, i.e.
Target - Wrapper for Target specific information.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
raw_ostream & write_zeros(unsigned NumZeros)
write_zeros - Insert 'NumZeros' nulls.
uint64_t tell() const
tell - Return the current offset with the file.
raw_ostream & write(unsigned char C)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
bool isRelocRelocation(MCFixupKind FixupKind)
@ Resolved
Queried, materialization begun.
void write(void *memory, value_type value, endianness endian)
Write a value to memory with a particular endianness.
This is an optimization pass for GlobalISel generic memory operations.
T bit_ceil(T Value)
Returns the smallest integral power of two no smaller than Value if Value is nonzero.
LLVM_ABI void reportFatalInternalError(Error Err)
Report a fatal error that indicates a bug in LLVM.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
uint64_t offsetToAlignment(uint64_t Value, Align Alignment)
Returns the offset to the next integer (mod 2**64) that is greater than or equal to Value and is a mu...
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
@ Ref
The access may reference the value stored in memory.
@ Sub
Subtraction of integers.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Count
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
unsigned encodeSLEB128(int64_t Value, raw_ostream &OS, unsigned PadTo=0)
Utility function to encode a SLEB128 value to an output stream.
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
unsigned encodeULEB128(uint64_t Value, raw_ostream &OS, unsigned PadTo=0)
Utility function to encode a ULEB128 value to an output stream.
unsigned Log2(Align A)
Returns the log2 of the alignment.
LLVM_ABI void reportFatalUsageError(Error Err)
Report a fatal error that does not indicate a bug in LLVM.
Implement std::hash so that hash_code can be used in STL containers.
This struct is a compact representation of a valid (non-zero power of two) alignment.
constexpr uint64_t value() const
This is a hole in the type system and should not be abused.