diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-08-17 05:49:08 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-08-17 05:49:08 +0000 |
| commit | 975780bb595b57a45a8e6d72d8151b436314ce22 (patch) | |
| tree | 608145582519a558587437839df9930c525629d7 /lib/MC | |
| parent | d3aa25e2a8b04853f03341b6275ef7718659b915 (diff) | |
| download | external_llvm-975780bb595b57a45a8e6d72d8151b436314ce22.zip external_llvm-975780bb595b57a45a8e6d72d8151b436314ce22.tar.gz external_llvm-975780bb595b57a45a8e6d72d8151b436314ce22.tar.bz2 | |
change AsmPrinter to switch sections using AsmStreamer instead of
doing it directly. This requires const'izing a bunch of stuff that
took sections, but this seems like the right semantic thing to do:
emitting a label to a section shouldn't mutate the MCSection object
itself, for example.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79227 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
| -rw-r--r-- | lib/MC/MCAsmStreamer.cpp | 10 | ||||
| -rw-r--r-- | lib/MC/MCNullStreamer.cpp | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp index db39fb8..60d66f9 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 3ac79cb..fcdd087 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) {} |
