diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 13 | ||||
-rw-r--r-- | lib/MC/MCAsmStreamer.cpp | 10 | ||||
-rw-r--r-- | lib/MC/MCNullStreamer.cpp | 2 |
3 files changed, 9 insertions, 16 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index d46043b29c..7f23abe4ee 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -98,23 +98,18 @@ TargetLoweringObjectFile &AsmPrinter::getObjFileLowering() const { /// FIXME: Remove support for null sections. /// void AsmPrinter::SwitchToSection(const MCSection *NS) { - // If we're already in this section, we're done. - if (CurrentSection == NS) return; - CurrentSection = NS; - - if (NS == 0) return; - - NS->PrintSwitchToSection(*TAI, O); + // FIXME: Remove support for null sections! + if (NS) + OutStreamer.SwitchSection(NS); } void AsmPrinter::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); MachineFunctionPass::getAnalysisUsage(AU); AU.addRequired<GCModuleInfo>(); - if (ExuberantAsm) { + if (ExuberantAsm) AU.addRequired<MachineLoopInfo>(); - } } bool AsmPrinter::doInitialization(Module &M) { diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index db39fb8b1c..60d66f93af 100644 --- a/lib/MC/MCAsmStreamer.cpp +++ b/lib/MC/MCAsmStreamer.cpp @@ -24,7 +24,7 @@ class MCAsmStreamer : public MCStreamer { raw_ostream &OS; const TargetAsmInfo &TAI; AsmPrinter *Printer; - MCSection *CurSection; + const MCSection *CurSection; public: MCAsmStreamer(MCContext &Context, raw_ostream &_OS, const TargetAsmInfo &tai, AsmPrinter *_AsmPrinter) @@ -35,7 +35,7 @@ public: /// @name MCStreamer Interface /// @{ - virtual void SwitchSection(MCSection *Section); + virtual void SwitchSection(const MCSection *Section); virtual void EmitLabel(MCSymbol *Symbol); @@ -98,12 +98,10 @@ static inline MCValue truncateToSize(const MCValue &Value, unsigned Bytes) { truncateToSize(Value.getConstant(), Bytes)); } -void MCAsmStreamer::SwitchSection(MCSection *Section) { +void MCAsmStreamer::SwitchSection(const MCSection *Section) { if (Section != CurSection) { CurSection = Section; - - // FIXME: Needs TargetAsmInfo! - Section->PrintSwitchToSection(*(const TargetAsmInfo*)0, OS); + Section->PrintSwitchToSection(TAI, OS); } } diff --git a/lib/MC/MCNullStreamer.cpp b/lib/MC/MCNullStreamer.cpp index 3ac79cbf0a..fcdd087e67 100644 --- a/lib/MC/MCNullStreamer.cpp +++ b/lib/MC/MCNullStreamer.cpp @@ -26,7 +26,7 @@ namespace { /// @name MCStreamer Interface /// @{ - virtual void SwitchSection(MCSection *Section) {} + virtual void SwitchSection(const MCSection *Section) {} virtual void EmitLabel(MCSymbol *Symbol) {} |