diff options
Diffstat (limited to 'llvm/include/llvm/MC/MCObjectStreamer.h')
| -rw-r--r-- | llvm/include/llvm/MC/MCObjectStreamer.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/llvm/include/llvm/MC/MCObjectStreamer.h b/llvm/include/llvm/MC/MCObjectStreamer.h index e10487988f6..d8ea75a0ee7 100644 --- a/llvm/include/llvm/MC/MCObjectStreamer.h +++ b/llvm/include/llvm/MC/MCObjectStreamer.h @@ -38,6 +38,8 @@ class MCObjectStreamer : public MCStreamer { bool EmitEHFrame; bool EmitDebugFrame; SmallVector<MCSymbol *, 2> PendingLabels; + SmallVector<MCSection*, 2> PendingLabelSections; + unsigned CurSubsectionIdx; struct PendingMCFixup { const MCSymbol *Sym; MCFixup Fixup; @@ -87,17 +89,23 @@ public: protected: bool changeSectionImpl(MCSection *Section, const MCExpr *Subsection); - /// If any labels have been emitted but not assigned fragments, ensure that - /// they get assigned, either to F if possible or to a new data fragment. - /// Optionally, it is also possible to provide an offset \p FOffset, which - /// will be used as a symbol offset within the fragment. + /// Assign a label to the current Section and Subsection even though a + /// fragment is not yet present. Use flushPendingLabels(F) to associate + /// a fragment with this label. + void addPendingLabel(MCSymbol* label); + + /// If any labels have been emitted but not assigned fragments in the current + /// Section and Subsection, ensure that they get assigned, either to fragment + /// F if possible or to a new data fragment. Optionally, one can provide an + /// offset \p FOffset as a symbol offset within the fragment. void flushPendingLabels(MCFragment *F, uint64_t FOffset = 0); public: void visitUsedSymbol(const MCSymbol &Sym) override; - /// Create a dummy fragment to assign any pending labels. - void flushPendingLabels() { flushPendingLabels(nullptr); } + /// Create a data fragment for any pending labels across all Sections + /// and Subsections. + void flushPendingLabels(); MCAssembler &getAssembler() { return *Assembler; } MCAssembler *getAssemblerPtr() override; |

