13#include "llvm/Config/llvm-config.h"
30 : Kind(Kind), HasInstructions(HasInstructions), LinkerRelaxable(
false) {}
35 cast<MCAlignFragment>(
this)->~MCAlignFragment();
38 cast<MCDataFragment>(
this)->~MCDataFragment();
41 cast<MCCompactEncodedInstFragment>(
this)->~MCCompactEncodedInstFragment();
44 cast<MCFillFragment>(
this)->~MCFillFragment();
47 cast<MCNopsFragment>(
this)->~MCNopsFragment();
50 cast<MCRelaxableFragment>(
this)->~MCRelaxableFragment();
53 cast<MCOrgFragment>(
this)->~MCOrgFragment();
56 cast<MCDwarfLineAddrFragment>(
this)->~MCDwarfLineAddrFragment();
59 cast<MCDwarfCallFrameFragment>(
this)->~MCDwarfCallFrameFragment();
62 cast<MCLEBFragment>(
this)->~MCLEBFragment();
65 cast<MCBoundaryAlignFragment>(
this)->~MCBoundaryAlignFragment();
68 cast<MCSymbolIdFragment>(
this)->~MCSymbolIdFragment();
71 cast<MCCVInlineLineTableFragment>(
this)->~MCCVInlineLineTableFragment();
74 cast<MCCVDefRangeFragment>(
this)->~MCCVDefRangeFragment();
77 cast<MCPseudoProbeAddrFragment>(
this)->~MCPseudoProbeAddrFragment();
80 cast<MCDummyFragment>(
this)->~MCDummyFragment();
86 return cast<MCSectionMachO>(Parent)->getAtom(LayoutOrder);
96 <<
" Kind:" << AF.
getKind() <<
">";
102#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
111 OS <<
"MCCompactEncodedInstFragment";
break;
114 OS <<
"MCFNopsFragment";
126 OS <<
"MCPseudoProbe";
131 OS <<
"<MCFragment " << (
const void *)
this <<
" LayoutOrder:" << LayoutOrder
133 if (
const auto *EF = dyn_cast<MCEncodedFragment>(
this))
134 OS <<
" BundlePadding:" <<
static_cast<unsigned>(EF->getBundlePadding());
139 const auto *AF = cast<MCAlignFragment>(
this);
140 if (AF->hasEmitNops())
141 OS <<
" (emit nops)";
143 OS <<
" Alignment:" << AF->getAlignment().value()
144 <<
" Value:" << AF->getValue() <<
" ValueSize:" << AF->getValueSize()
145 <<
" MaxBytesToEmit:" << AF->getMaxBytesToEmit() <<
">";
149 const auto *
DF = cast<MCDataFragment>(
this);
153 for (
unsigned i = 0, e = Contents.
size(); i != e; ++i) {
155 OS << hexdigit((Contents[i] >> 4) & 0xF) << hexdigit(Contents[i] & 0xF);
157 OS <<
"] (" << Contents.
size() <<
" bytes)";
159 if (
DF->fixup_begin() !=
DF->fixup_end()) {
163 ie =
DF->fixup_end(); it != ie; ++it) {
164 if (it !=
DF->fixup_begin())
OS <<
",\n ";
173 cast<MCCompactEncodedInstFragment>(
this);
177 for (
unsigned i = 0, e = Contents.
size(); i != e; ++i) {
179 OS << hexdigit((Contents[i] >> 4) & 0xF) << hexdigit(Contents[i] & 0xF);
181 OS <<
"] (" << Contents.
size() <<
" bytes)";
185 const auto *FF = cast<MCFillFragment>(
this);
186 OS <<
" Value:" <<
static_cast<unsigned>(FF->getValue())
187 <<
" ValueSize:" <<
static_cast<unsigned>(FF->getValueSize())
188 <<
" NumValues:" << FF->getNumValues();
192 const auto *NF = cast<MCNopsFragment>(
this);
193 OS <<
" NumBytes:" << NF->getNumBytes()
194 <<
" ControlledNopLength:" << NF->getControlledNopLength();
198 const auto *
F = cast<MCRelaxableFragment>(
this);
201 F->getInst().dump_pretty(
OS);
202 OS <<
" (" <<
F->getContents().size() <<
" bytes)";
206 const auto *OF = cast<MCOrgFragment>(
this);
208 OS <<
" Offset:" << OF->getOffset()
209 <<
" Value:" <<
static_cast<unsigned>(OF->getValue());
213 const auto *OF = cast<MCDwarfLineAddrFragment>(
this);
215 OS <<
" AddrDelta:" << OF->getAddrDelta()
216 <<
" LineDelta:" << OF->getLineDelta();
220 const auto *CF = cast<MCDwarfCallFrameFragment>(
this);
222 OS <<
" AddrDelta:" << CF->getAddrDelta();
226 const auto *LF = cast<MCLEBFragment>(
this);
228 OS <<
" Value:" << LF->getValue() <<
" Signed:" << LF->isSigned();
232 const auto *BF = cast<MCBoundaryAlignFragment>(
this);
234 OS <<
" BoundarySize:" << BF->getAlignment().value()
235 <<
" LastFragment:" << BF->getLastFragment()
236 <<
" Size:" << BF->getSize();
240 const auto *
F = cast<MCSymbolIdFragment>(
this);
242 OS <<
" Sym:" <<
F->getSymbol();
246 const auto *
F = cast<MCCVInlineLineTableFragment>(
this);
248 OS <<
" Sym:" << *
F->getFnStartSym();
252 const auto *
F = cast<MCCVDefRangeFragment>(
this);
254 for (std::pair<const MCSymbol *, const MCSymbol *> RangeStartEnd :
256 OS <<
" RangeStart:" << RangeStartEnd.first;
257 OS <<
" RangeEnd:" << RangeStartEnd.second;
262 const auto *OF = cast<MCPseudoProbeAddrFragment>(
this);
264 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)