mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-13 09:33:50 +00:00
Oh yeah, there are two of these now, unify both.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28192 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b81cb6133e
commit
a7090ae7a3
@ -65,36 +65,29 @@ AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm)
|
||||
void AsmPrinter::SwitchToTextSection(const char *NewSection,
|
||||
const GlobalValue *GV) {
|
||||
std::string NS;
|
||||
|
||||
// Microsoft ML/MASM has a fundamentally different approach to handling
|
||||
// sections.
|
||||
|
||||
if (MLSections) {
|
||||
if (GV && GV->hasSection())
|
||||
NS = GV->getSection();
|
||||
else
|
||||
NS = NewSection;
|
||||
|
||||
if (CurrentSection != NS) {
|
||||
// If we're already in this section, we're done.
|
||||
if (CurrentSection == NS) return;
|
||||
|
||||
// Microsoft ML/MASM has a fundamentally different approach to handling
|
||||
// sections.
|
||||
|
||||
if (MLSections) {
|
||||
if (!CurrentSection.empty())
|
||||
O << CurrentSection << "\tends\n\n";
|
||||
CurrentSection = NS;
|
||||
if (!CurrentSection.empty())
|
||||
O << CurrentSection << "\tsegment 'CODE'\n";
|
||||
}
|
||||
} else {
|
||||
if (GV && GV->hasSection())
|
||||
NS = SwitchToSectionDirective + GV->getSection();
|
||||
else
|
||||
NS = std::string("\t")+NewSection;
|
||||
|
||||
if (CurrentSection != NS) {
|
||||
CurrentSection = NS;
|
||||
if (!CurrentSection.empty())
|
||||
O << CurrentSection << '\n';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// SwitchToTextSection - Switch to the specified text section of the executable
|
||||
/// if we are not already in it!
|
||||
|
Loading…
x
Reference in New Issue
Block a user