mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-12-19 11:23:32 +00:00
There is only one current section.
Both MCStreamer and MCObjectStreamer were maintaining a current section variable and they were slightly out of sync. I don't think this was observable, but was inefficient and error prone. Changing this requires a few cascading changes: * SwitchSection has to call ChangeSection earlier for ChangeSection to see the old section. * With that change, ChangeSection cannot call EmitLabel, since during ChangeSection we are still in the old section. * When the object streamer requires a begin label, just reused the existing generic support for begin labels instead of calling EmitLabel directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238357 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -35,7 +35,6 @@ class raw_pwrite_stream;
|
||||
/// implementation.
|
||||
class MCObjectStreamer : public MCStreamer {
|
||||
MCAssembler *Assembler;
|
||||
MCSection *CurSectionData;
|
||||
MCSection::iterator CurInsertionPoint;
|
||||
bool EmitEHFrame;
|
||||
bool EmitDebugFrame;
|
||||
@@ -64,14 +63,15 @@ public:
|
||||
void EmitCFISections(bool EH, bool Debug) override;
|
||||
|
||||
protected:
|
||||
MCSection *getCurrentSectionData() const { return CurSectionData; }
|
||||
MCSection *getCurrentSectionData() const { return getCurrentSection().first; }
|
||||
|
||||
MCFragment *getCurrentFragment() const;
|
||||
|
||||
void insert(MCFragment *F) {
|
||||
flushPendingLabels(F);
|
||||
CurSectionData->getFragmentList().insert(CurInsertionPoint, F);
|
||||
F->setParent(CurSectionData);
|
||||
MCSection *CurSection = getCurrentSectionData();
|
||||
CurSection->getFragmentList().insert(CurInsertionPoint, F);
|
||||
F->setParent(CurSection);
|
||||
}
|
||||
|
||||
/// Get a data fragment to write into, creating a new one if the current
|
||||
|
||||
Reference in New Issue
Block a user