12#include "llvm/Config/llvm-config.h"
25 : Begin(Begin), BundleGroupBeforeFirstInst(
false), HasInstructions(
false),
26 IsRegistered(
false), DummyFragment(this),
Name(
Name), Variant(V),
41 if (BundleLockNestingDepth == 0) {
44 if (--BundleLockNestingDepth == 0) {
53 BundleLockState = NewState;
55 ++BundleLockNestingDepth;
60 if (Subsection == 0 && SubsectionFragmentMap.empty())
64 SubsectionFragmentMap, std::make_pair(Subsection, (
MCFragment *)
nullptr));
65 bool ExactMatch =
false;
66 if (
MI != SubsectionFragmentMap.end()) {
67 ExactMatch =
MI->first == Subsection;
72 if (
MI == SubsectionFragmentMap.end())
75 IP =
MI->second->getIterator();
76 if (!ExactMatch && Subsection != 0) {
80 SubsectionFragmentMap.insert(
MI, std::make_pair(Subsection,
F));
83 F->setSubsectionNumber(Subsection);
92 PendingLabels.
push_back(PendingLabel(label, Subsection));
96 unsigned Subsection) {
99 for (
auto It = PendingLabels.
begin(); It != PendingLabels.
end(); ++It) {
100 PendingLabel& Label = *It;
101 if (Label.Subsection == Subsection) {
102 Label.Sym->setFragment(
F);
103 Label.Sym->setOffset(FOffset);
104 PendingLabels.
erase(It--);
112 while (!PendingLabels.
empty()) {
113 PendingLabel& Label = PendingLabels[0];
123#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
128 OS <<
" Fragments:[\n ";
129 for (
auto it =
begin(), ie =
end(); it != ie; ++it) {
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This file defines the SmallVector class.
Context object for machine code objects.
MCSymbol * createTempSymbol()
Create a temporary symbol with a unique name.
Fragment for data and encoded instructions.
void addPendingLabel(MCSymbol *label, unsigned Subsection=0)
Add a pending label for the requested subsection.
virtual StringRef getVirtualSectionKind() const
void flushPendingLabels()
Associate all pending labels with empty data fragments.
MCSection::FragmentListType & getFragmentList()
MCSymbol * getEndSymbol(MCContext &Ctx)
void setBundleLockState(BundleLockStateType NewState)
MCSection::iterator getSubsectionInsertionPoint(unsigned Subsection)
MCSection(SectionVariant V, StringRef Name, SectionKind K, MCSymbol *Begin)
BundleLockStateType
Express the state of bundle locked groups while emitting code.
FragmentListType::iterator iterator
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
bool isInSection() const
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute).
SectionKind - This is a simple POD value that classifies the properties of a section.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
iterator erase(const_iterator CI)
void push_back(const T &Elt)
StringRef - Represent a constant reference to a string, i.e.
iterator insert(iterator where, pointer New)
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 report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
auto lower_bound(R &&Range, T &&Value)
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...