summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCAsmStreamer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-17 05:49:08 +0000
committerChris Lattner <sabre@nondot.org>2009-08-17 05:49:08 +0000
commitaa1526419c1c3c01bdbc42ffc7b7488f7bffd69d (patch)
treef48c6ed95569667abcf09c50145ef207a89763e1 /llvm/lib/MC/MCAsmStreamer.cpp
parentaa464002f0f7d43996f10b43a9536a40cb144bef (diff)
downloadbcm5719-llvm-aa1526419c1c3c01bdbc42ffc7b7488f7bffd69d.tar.gz
bcm5719-llvm-aa1526419c1c3c01bdbc42ffc7b7488f7bffd69d.zip
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. llvm-svn: 79227
Diffstat (limited to 'llvm/lib/MC/MCAsmStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCAsmStreamer.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp
index db39fb8b1cb..60d66f93af9 100644
--- a/llvm/lib/MC/MCAsmStreamer.cpp
+++ b/llvm/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);
}
}
OpenPOWER on IntegriCloud