summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
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/CodeGen
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/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index d46043b29cd..7f23abe4ee1 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/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) {
OpenPOWER on IntegriCloud