summaryrefslogtreecommitdiff
path: root/lib
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
commitcda7f78233b889772e1454a1246130c576681bb8 (patch)
treee66ad5ed66a77a73abbd7b009be914ebda7bfdce /lib
parentbea2c957046e43622b43bed814dd96d772eb0628 (diff)
downloadllvm-cda7f78233b889772e1454a1246130c576681bb8.tar.gz
llvm-cda7f78233b889772e1454a1246130c576681bb8.tar.bz2
llvm-cda7f78233b889772e1454a1246130c576681bb8.tar.xz
prune some redundant #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79746 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/MC/MCMachOStreamer.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/MC/MCMachOStreamer.cpp b/lib/MC/MCMachOStreamer.cpp
index 1a648ea5e4..caff1256d3 100644
--- a/lib/MC/MCMachOStreamer.cpp
+++ b/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) {