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->fixup_begin() !=
DF->fixup_end()) {
157 ie =
DF->fixup_end(); it != ie; ++it) {
158 if (it !=
DF->fixup_begin())
OS <<
",\n ";
166 const auto *FF = cast<MCFillFragment>(
this);
167 OS <<
" Value:" <<
static_cast<unsigned>(FF->getValue())
168 <<
" ValueSize:" <<
static_cast<unsigned>(FF->getValueSize())
169 <<
" NumValues:" << FF->getNumValues();
173 const auto *NF = cast<MCNopsFragment>(
this);
174 OS <<
" NumBytes:" << NF->getNumBytes()
175 <<
" ControlledNopLength:" << NF->getControlledNopLength();
179 const auto *
F = cast<MCRelaxableFragment>(
this);
182 F->getInst().dump_pretty(
OS);
183 OS <<
" (" <<
F->getContents().size() <<
" bytes)";
187 const auto *OF = cast<MCOrgFragment>(
this);
189 OS <<
" Offset:" << OF->getOffset()
190 <<
" Value:" <<
static_cast<unsigned>(OF->getValue());
194 const auto *OF = cast<MCDwarfLineAddrFragment>(
this);
196 OS <<
" AddrDelta:" << OF->getAddrDelta()
197 <<
" LineDelta:" << OF->getLineDelta();
201 const auto *CF = cast<MCDwarfCallFrameFragment>(
this);
203 OS <<
" AddrDelta:" << CF->getAddrDelta();
207 const auto *LF = cast<MCLEBFragment>(
this);
209 OS <<
" Value:" << LF->getValue() <<
" Signed:" << LF->isSigned();
213 const auto *BF = cast<MCBoundaryAlignFragment>(
this);
215 OS <<
" BoundarySize:" << BF->getAlignment().value()
216 <<
" LastFragment:" << BF->getLastFragment()
217 <<
" Size:" << BF->getSize();
221 const auto *
F = cast<MCSymbolIdFragment>(
this);
223 OS <<
" Sym:" <<
F->getSymbol();
227 const auto *
F = cast<MCCVInlineLineTableFragment>(
this);
229 OS <<
" Sym:" << *
F->getFnStartSym();
233 const auto *
F = cast<MCCVDefRangeFragment>(
this);
235 for (std::pair<const MCSymbol *, const MCSymbol *> RangeStartEnd :
237 OS <<
" RangeStart:" << RangeStartEnd.first;
238 OS <<
" RangeEnd:" << RangeStartEnd.second;
243 const auto *OF = cast<MCPseudoProbeAddrFragment>(
this);
245 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.
SmallVectorImpl< MCFixup >::const_iterator const_fixup_iterator
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.
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)