13#include "llvm/Config/llvm-config.h"
28 : Kind(Kind), HasInstructions(HasInstructions), AlignToBundleEnd(
false),
29 LinkerRelaxable(
false), AllowAutoPadding(
false) {}
34 cast<MCAlignFragment>(
this)->~MCAlignFragment();
37 cast<MCDataFragment>(
this)->~MCDataFragment();
40 cast<MCFillFragment>(
this)->~MCFillFragment();
43 cast<MCNopsFragment>(
this)->~MCNopsFragment();
46 cast<MCRelaxableFragment>(
this)->~MCRelaxableFragment();
49 cast<MCOrgFragment>(
this)->~MCOrgFragment();
52 cast<MCDwarfLineAddrFragment>(
this)->~MCDwarfLineAddrFragment();
55 cast<MCDwarfCallFrameFragment>(
this)->~MCDwarfCallFrameFragment();
58 cast<MCLEBFragment>(
this)->~MCLEBFragment();
61 cast<MCBoundaryAlignFragment>(
this)->~MCBoundaryAlignFragment();
64 cast<MCSymbolIdFragment>(
this)->~MCSymbolIdFragment();
67 cast<MCCVInlineLineTableFragment>(
this)->~MCCVInlineLineTableFragment();
70 cast<MCCVDefRangeFragment>(
this)->~MCCVDefRangeFragment();
73 cast<MCPseudoProbeAddrFragment>(
this)->~MCPseudoProbeAddrFragment();
76 cast<MCDummyFragment>(
this)->~MCDummyFragment();
82 return cast<MCSectionMachO>(Parent)->getAtom(LayoutOrder);
92 <<
" Kind:" << AF.
getKind() <<
">";
98#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
108 OS <<
"MCFNopsFragment";
120 OS <<
"MCPseudoProbe";
125 OS <<
"<MCFragment " << (
const void *)
this <<
" LayoutOrder:" << LayoutOrder
127 if (
const auto *EF = dyn_cast<MCEncodedFragment>(
this))
128 OS <<
" BundlePadding:" <<
static_cast<unsigned>(EF->getBundlePadding());
133 const auto *AF = cast<MCAlignFragment>(
this);
134 if (AF->hasEmitNops())
135 OS <<
" (emit nops)";
137 OS <<
" Alignment:" << AF->getAlignment().value()
138 <<
" Value:" << AF->getValue() <<
" ValueSize:" << AF->getValueSize()
139 <<
" MaxBytesToEmit:" << AF->getMaxBytesToEmit() <<
">";
143 const auto *
DF = cast<MCDataFragment>(
this);
147 for (
unsigned i = 0, e = Contents.
size(); i != e; ++i) {
149 OS << hexdigit((Contents[i] >> 4) & 0xF) << hexdigit(Contents[i] & 0xF);
151 OS <<
"] (" << Contents.
size() <<
" bytes)";
153 if (
DF->getFixups().size()) {
162 const auto *FF = cast<MCFillFragment>(
this);
163 OS <<
" Value:" <<
static_cast<unsigned>(FF->getValue())
164 <<
" ValueSize:" <<
static_cast<unsigned>(FF->getValueSize())
165 <<
" NumValues:" << FF->getNumValues();
169 const auto *NF = cast<MCNopsFragment>(
this);
170 OS <<
" NumBytes:" << NF->getNumBytes()
171 <<
" ControlledNopLength:" << NF->getControlledNopLength();
175 const auto *
F = cast<MCRelaxableFragment>(
this);
178 F->getInst().dump_pretty(
OS);
179 OS <<
" (" <<
F->getContents().size() <<
" bytes)";
183 const auto *OF = cast<MCOrgFragment>(
this);
185 OS <<
" Offset:" << OF->getOffset()
186 <<
" Value:" <<
static_cast<unsigned>(OF->getValue());
190 const auto *OF = cast<MCDwarfLineAddrFragment>(
this);
192 OS <<
" AddrDelta:" << OF->getAddrDelta()
193 <<
" LineDelta:" << OF->getLineDelta();
197 const auto *CF = cast<MCDwarfCallFrameFragment>(
this);
199 OS <<
" AddrDelta:" << CF->getAddrDelta();
203 const auto *LF = cast<MCLEBFragment>(
this);
205 OS <<
" Value:" << LF->getValue() <<
" Signed:" << LF->isSigned();
209 const auto *BF = cast<MCBoundaryAlignFragment>(
this);
211 OS <<
" BoundarySize:" << BF->getAlignment().value()
212 <<
" LastFragment:" << BF->getLastFragment()
213 <<
" Size:" << BF->getSize();
217 const auto *
F = cast<MCSymbolIdFragment>(
this);
219 OS <<
" Sym:" <<
F->getSymbol();
223 const auto *
F = cast<MCCVInlineLineTableFragment>(
this);
225 OS <<
" Sym:" << *
F->getFnStartSym();
229 const auto *
F = cast<MCCVDefRangeFragment>(
this);
231 for (std::pair<const MCSymbol *, const MCSymbol *> RangeStartEnd :
233 OS <<
" RangeStart:" << RangeStartEnd.first;
234 OS <<
" RangeEnd:" << RangeStartEnd.second;
239 const auto *OF = cast<MCPseudoProbeAddrFragment>(
this);
241 OS <<
" AddrDelta:" << OF->getAddrDelta();
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
static RegisterPass< DebugifyFunctionPass > DF("debugify-function", "Attach debug info to a function")
This file defines the SmallVector class.
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
const MCExpr * getValue() const
uint32_t getOffset() const
MCFixupKind getKind() const
FragmentType getKind() const
const MCSymbol * getAtom() const
void destroy()
Destroys the current fragment.
bool hasInstructions() const
Does this fragment have instructions emitted into it? By default this is false, but specific fragment...
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
void interleave(ForwardIterator begin, ForwardIterator end, UnaryFunctor each_fn, NullaryFunctor between_fn)
An STL-style algorithm similar to std::for_each that applies a second functor between every pair of e...
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)