mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-22 13:29:44 +00:00
llvm-mc: Factor getSectionData out of SwitchSection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80344 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e6cdbf2f92
commit
0f5fa69551
@ -63,6 +63,15 @@ private:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MCSectionData &getSectionData(const MCSection &Section) {
|
||||||
|
MCSectionData *&Entry = SectionMap[&Section];
|
||||||
|
|
||||||
|
if (!Entry)
|
||||||
|
Entry = new MCSectionData(Section, &Assembler);
|
||||||
|
|
||||||
|
return *Entry;
|
||||||
|
}
|
||||||
|
|
||||||
MCSymbolData &getSymbolData(MCSymbol &Symbol) {
|
MCSymbolData &getSymbolData(MCSymbol &Symbol) {
|
||||||
MCSymbolData *&Entry = SymbolMap[&Symbol];
|
MCSymbolData *&Entry = SymbolMap[&Symbol];
|
||||||
|
|
||||||
@ -135,14 +144,9 @@ void MCMachOStreamer::SwitchSection(const MCSection *Section) {
|
|||||||
|
|
||||||
// If already in this section, then this is a noop.
|
// If already in this section, then this is a noop.
|
||||||
if (Section == CurSection) return;
|
if (Section == CurSection) return;
|
||||||
|
|
||||||
CurSection = Section;
|
CurSection = Section;
|
||||||
MCSectionData *&Entry = SectionMap[Section];
|
CurSectionData = &getSectionData(*Section);
|
||||||
|
|
||||||
if (!Entry)
|
|
||||||
Entry = new MCSectionData(*Section, &Assembler);
|
|
||||||
|
|
||||||
CurSectionData = Entry;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCMachOStreamer::EmitLabel(MCSymbol *Symbol) {
|
void MCMachOStreamer::EmitLabel(MCSymbol *Symbol) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user