mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-30 02:25:19 +00:00
Close unique sections when switching away from them.
It is not possible to switch back to unique secitons, so close them automatically when switching away. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233380 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -669,6 +669,12 @@ void MCStreamer::SwitchSection(const MCSection *Section,
|
||||
MCSectionSubPair curSection = SectionStack.back().first;
|
||||
SectionStack.back().second = curSection;
|
||||
if (MCSectionSubPair(Section, Subsection) != curSection) {
|
||||
const MCSection *CurSec = curSection.first;
|
||||
if (CurSec && CurSec->isUnique()) {
|
||||
MCSymbol *Sym = curSection.first->getEndSymbol(Context);
|
||||
if (!Sym->isInSection())
|
||||
EmitLabel(Sym);
|
||||
}
|
||||
SectionStack.back().first = MCSectionSubPair(Section, Subsection);
|
||||
assert(!Section->hasEnded() && "Section already ended");
|
||||
ChangeSection(Section, Subsection);
|
||||
|
Reference in New Issue
Block a user