summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCMachOStreamer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-22 19:35:08 +0000
committerChris Lattner <sabre@nondot.org>2009-08-22 19:35:08 +0000
commitca098517a3d5bfe8dfc56cbb2f2aaa5e56438f7b (patch)
tree087788b1496ba7b345821a90c1ad1fa27ca922ff /llvm/lib/MC/MCMachOStreamer.cpp
parent1b5d6133f962f491a35aa8eb4d1e896210bf35fe (diff)
downloadbcm5719-llvm-ca098517a3d5bfe8dfc56cbb2f2aaa5e56438f7b.tar.gz
bcm5719-llvm-ca098517a3d5bfe8dfc56cbb2f2aaa5e56438f7b.zip
prune some redundant #includes.
llvm-svn: 79746
Diffstat (limited to 'llvm/lib/MC/MCMachOStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCMachOStreamer.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/llvm/lib/MC/MCMachOStreamer.cpp b/llvm/lib/MC/MCMachOStreamer.cpp
index 1a648ea5e4b..caff1256d3b 100644
--- a/llvm/lib/MC/MCMachOStreamer.cpp
+++ b/llvm/lib/MC/MCMachOStreamer.cpp
@@ -9,12 +9,10 @@
#include "llvm/MC/MCStreamer.h"
-#include "llvm/ADT/DenseMap.h"
#include "llvm/MC/MCAssembler.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCSymbol.h"
-#include "llvm/MC/MCValue.h"
#include "llvm/Support/ErrorHandling.h"
using namespace llvm;
@@ -99,16 +97,17 @@ public:
void MCMachOStreamer::SwitchSection(const MCSection *Section) {
assert(Section && "Cannot switch to a null section!");
+
+ // If already in this section, then this is a noop.
+ if (Section == CurSection) return;
+
+ CurSection = Section;
+ MCSectionData *&Entry = SectionMap[Section];
- if (Section != CurSection) {
- CurSection = Section;
- MCSectionData *&Entry = SectionMap[Section];
+ if (!Entry)
+ Entry = new MCSectionData(*Section, &Assembler);
- if (!Entry)
- Entry = new MCSectionData(*Section, &Assembler);
-
- CurSectionData = Entry;
- }
+ CurSectionData = Entry;
}
void MCMachOStreamer::EmitLabel(MCSymbol *Symbol) {
OpenPOWER on IntegriCloud