11#include "llvm/Config/llvm-config.h"
22 : Begin(Begin), HasInstructions(
false), IsRegistered(
false), IsText(IsText),
24 DummyFragment.setParent(
this);
29 End = Ctx.createTempSymbol(
"sec_end");
45#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
51 OS <<
"MCSection Name:" <<
getName();
54 for (
auto &
F : *
this) {
59 auto It = FragToSyms->find(&
F);
60 if (It == FragToSyms->end())
62 for (
auto *Sym : It->second) {
63 OS <<
"\n Symbol @" << Sym->getOffset() <<
' ' << Sym->getName();
64 if (Sym->isTemporary())
73 if (VarContentStart + Contents.
size() > VarContentEnd) {
74 VarContentStart = S.size();
75 S.resize_for_overwrite(S.size() + Contents.
size());
77 VarContentEnd = VarContentStart + Contents.
size();
88 auto Size = FixupEnd - FixupStart;
89 auto I = std::exchange(FixupStart, S.size());
90 S.reserve(S.size() +
Size);
91 S.append(S.begin() +
I, S.begin() +
I +
Size);
93 S.append(Fixups.begin(), Fixups.end());
98 assert(Fixups.size() < 256 &&
99 "variable-size tail cannot have more than 256 fixups");
101 if (Fixups.size() > VarFixupSize) {
102 VarFixupStart = S.size();
103 S.resize_for_overwrite(S.size() + Fixups.size());
105 VarFixupSize = Fixups.size();
108 std::transform(Fixups.begin(), Fixups.end(), S.begin() + VarFixupStart,
110 F.setOffset(
Fixed +
F.getOffset());
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define LLVM_UNLIKELY(EXPR)
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
PowerPC TLS Dynamic Call Fixup
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
Context object for machine code objects.
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
LLVM_ABI void appendFixups(ArrayRef< MCFixup > Fixups)
MCSection * getParent() const
LLVM_ABI void setVarFixups(ArrayRef< MCFixup > Fixups)
LLVM_ABI void addFixup(MCFixup Fixup)
size_t getFixedSize() const
LLVM_ABI void setVarContents(ArrayRef< char > Contents)
Align getPreferredAlignment() const
Align getAlignmentForObjectFile(uint64_t Size) const
MCSymbol * getEndSymbol(MCContext &Ctx)
bool isLinkerRelaxable() const
void dump(DenseMap< const MCFragment *, SmallVector< const MCSymbol *, 0 > > *FragToSyms=nullptr) const
StringRef getName() const
unsigned firstLinkerRelaxable() const
MCSection(StringRef Name, bool IsText, bool IsBss, MCSymbol *Begin)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
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.
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
OutputIt copy(R &&Range, OutputIt Out)
constexpr uint64_t NextPowerOf2(uint64_t A)
Returns the next power of two (in 64-bits) that is strictly greater than A.
This struct is a compact representation of a valid (non-zero power of two) alignment.