mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 19:12:56 +02:00
Oh yeah, there are two of these now, unify both.
llvm-svn: 28192
This commit is contained in:
parent
d2aea9851e
commit
28fe830b3b
@ -65,34 +65,27 @@ AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm)
|
||||
void AsmPrinter::SwitchToTextSection(const char *NewSection,
|
||||
const GlobalValue *GV) {
|
||||
std::string NS;
|
||||
if (GV && GV->hasSection())
|
||||
NS = GV->getSection();
|
||||
else
|
||||
NS = NewSection;
|
||||
|
||||
// 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 (GV && GV->hasSection())
|
||||
NS = GV->getSection();
|
||||
else
|
||||
NS = NewSection;
|
||||
|
||||
if (CurrentSection != NS) {
|
||||
if (!CurrentSection.empty())
|
||||
O << CurrentSection << "\tends\n\n";
|
||||
CurrentSection = NS;
|
||||
if (!CurrentSection.empty())
|
||||
O << CurrentSection << "\tsegment 'CODE'\n";
|
||||
}
|
||||
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';
|
||||
}
|
||||
CurrentSection = NS;
|
||||
if (!CurrentSection.empty())
|
||||
O << CurrentSection << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user