11 #include "llvm/Config/llvm-config.h" 24 : Begin(Begin), BundleGroupBeforeFirstInst(
false), HasInstructions(
false),
25 IsRegistered(
false), DummyFragment(this), Variant(V),
Kind(K) {}
39 if (BundleLockNestingDepth == 0) {
42 if (--BundleLockNestingDepth == 0) {
51 BundleLockState = NewState;
53 ++BundleLockNestingDepth;
58 if (Subsection == 0 && SubsectionFragmentMap.empty())
63 SubsectionFragmentMap.end(),
64 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));
89 PendingLabels.
push_back(PendingLabel(label, Subsection));
93 unsigned Subsection) {
94 if (PendingLabels.
empty())
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) {
auto lower_bound(R &&Range, T &&Value) -> decltype(adl_begin(Range))
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
void addPendingLabel(MCSymbol *label, unsigned Subsection=0)
Add a pending label for the requested subsection.
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class represents lattice values for constants.
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds...
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
void push_back(const T &Elt)
MCSection(SectionVariant V, SectionKind K, MCSymbol *Begin)
void setBundleLockState(BundleLockStateType NewState)
BundleLockStateType
Express the state of bundle locked groups while emitting code.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
bool isInSection() const
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute)...
MCSymbol * getEndSymbol(MCContext &Ctx)
Context object for machine code objects.
void flushPendingLabels()
Associate all pending labels with empty data fragments.
MCSymbol * createTempSymbol(bool CanBeUnnamed=true)
Create and return a new assembler temporary symbol with a unique but unspecified name.
SectionKind - This is a simple POD value that classifies the properties of a section.
iterator erase(const_iterator CI)
Iterator for intrusive lists based on ilist_node.
iterator insert(iterator where, pointer New)
LLVM_NODISCARD bool empty() const
Fragment for data and encoded instructions.
MCSection::iterator getSubsectionInsertionPoint(unsigned Subsection)
This class implements an extremely fast bulk output stream that can only output to a stream...
void setParent(MCSection *Value)
MCSection::FragmentListType & getFragmentList()