13#include "llvm/Config/llvm-config.h"
30 : Kind(Kind), HasInstructions(HasInstructions), AlignToBundleEnd(
false),
31 LinkerRelaxable(
false), AllowAutoPadding(
false) {}
36 cast<MCAlignFragment>(
this)->~MCAlignFragment();
39 cast<MCDataFragment>(
this)->~MCDataFragment();
42 cast<MCFillFragment>(
this)->~MCFillFragment();
45 cast<MCNopsFragment>(
this)->~MCNopsFragment();
48 cast<MCRelaxableFragment>(
this)->~MCRelaxableFragment();
51 cast<MCOrgFragment>(
this)->~MCOrgFragment();
54 cast<MCDwarfLineAddrFragment>(
this)->~MCDwarfLineAddrFragment();
57 cast<MCDwarfCallFrameFragment>(
this)->~MCDwarfCallFrameFragment();
60 cast<MCLEBFragment>(
this)->~MCLEBFragment();
63 cast<MCBoundaryAlignFragment>(
this)->~MCBoundaryAlignFragment();
66 cast<MCSymbolIdFragment>(
this)->~MCSymbolIdFragment();
69 cast<MCCVInlineLineTableFragment>(
this)->~MCCVInlineLineTableFragment();
72 cast<MCCVDefRangeFragment>(
this)->~MCCVDefRangeFragment();
75 cast<MCPseudoProbeAddrFragment>(
this)->~MCPseudoProbeAddrFragment();
78 cast<MCDummyFragment>(
this)->~MCDummyFragment();
84 return cast<MCSectionMachO>(Parent)->getAtom(LayoutOrder);
94 <<
" Kind:" << AF.
getKind() <<
">";
100#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
110 OS <<
"MCFNopsFragment";
122 OS <<
"MCPseudoProbe";
127 OS <<
"<MCFragment " << (
const void *)
this <<
" LayoutOrder:" << LayoutOrder
129 if (
const auto *EF = dyn_cast<MCEncodedFragment>(
this))
130 OS <<
" BundlePadding:" <<
static_cast<unsigned>(EF->getBundlePadding());
135 const auto *AF = cast<MCAlignFragment>(
this);
136 if (AF->hasEmitNops())
137 OS <<
" (emit nops)";
139 OS <<
" Alignment:" << AF->getAlignment().value()
140 <<
" Value:" << AF->getValue() <<
" ValueSize:" << AF->getValueSize()
141 <<
" MaxBytesToEmit:" << AF->getMaxBytesToEmit() <<
">";
145 const auto *
DF = cast<MCDataFragment>(
this);
149 for (
unsigned i = 0, e = Contents.
size(); i != e; ++i) {
151 OS << hexdigit((Contents[i] >> 4) & 0xF) << hexdigit(Contents[i] & 0xF);
153 OS <<
"] (" << Contents.
size() <<
" bytes)";
155 if (
DF->fixup_begin() !=
DF->fixup_end()) {
159 ie =
DF->fixup_end(); it != ie; ++it) {
160 if (it !=
DF->fixup_begin())
OS <<
",\n ";
168 const auto *FF = cast<MCFillFragment>(
this);
169 OS <<
" Value:" <<
static_cast<unsigned>(FF->getValue())
170 <<
" ValueSize:" <<
static_cast<unsigned>(FF->getValueSize())
171 <<
" NumValues:" << FF->getNumValues();
175 const auto *NF = cast<MCNopsFragment>(
this);
176 OS <<
" NumBytes:" << NF->getNumBytes()
177 <<
" ControlledNopLength:" << NF->getControlledNopLength();
181 const auto *
F = cast<MCRelaxableFragment>(
this);
184 F->getInst().dump_pretty(
OS);
185 OS <<
" (" <<
F->getContents().size() <<
" bytes)";
189 const auto *OF = cast<MCOrgFragment>(
this);
191 OS <<
" Offset:" << OF->getOffset()
192 <<
" Value:" <<
static_cast<unsigned>(OF->getValue());
196 const auto *OF = cast<MCDwarfLineAddrFragment>(
this);
198 OS <<
" AddrDelta:" << OF->getAddrDelta()
199 <<
" LineDelta:" << OF->getLineDelta();
203 const auto *CF = cast<MCDwarfCallFrameFragment>(
this);
205 OS <<
" AddrDelta:" << CF->getAddrDelta();
209 const auto *LF = cast<MCLEBFragment>(
this);
211 OS <<
" Value:" << LF->getValue() <<
" Signed:" << LF->isSigned();
215 const auto *BF = cast<MCBoundaryAlignFragment>(
this);
217 OS <<
" BoundarySize:" << BF->getAlignment().value()
218 <<
" LastFragment:" << BF->getLastFragment()
219 <<
" Size:" << BF->getSize();
223 const auto *
F = cast<MCSymbolIdFragment>(
this);
225 OS <<
" Sym:" <<
F->getSymbol();
229 const auto *
F = cast<MCCVInlineLineTableFragment>(
this);
231 OS <<
" Sym:" << *
F->getFnStartSym();
235 const auto *
F = cast<MCCVDefRangeFragment>(
this);
237 for (std::pair<const MCSymbol *, const MCSymbol *> RangeStartEnd :
239 OS <<
" RangeStart:" << RangeStartEnd.first;
240 OS <<
" RangeEnd:" << RangeStartEnd.second;
245 const auto *OF = cast<MCPseudoProbeAddrFragment>(
this);
247 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)