[llvm-commits] [llvm] r79746 - /llvm/trunk/lib/MC/MCMachOStreamer.cpp

Chris Lattner sabre at nondot.org
Sat Aug 22 12:35:09 PDT 2009


Author: lattner
Date: Sat Aug 22 14:35:08 2009
New Revision: 79746

URL: http://llvm.org/viewvc/llvm-project?rev=79746&view=rev
Log:
prune some redundant #includes.

Modified:
    llvm/trunk/lib/MC/MCMachOStreamer.cpp

Modified: llvm/trunk/lib/MC/MCMachOStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCMachOStreamer.cpp?rev=79746&r1=79745&r2=79746&view=diff

==============================================================================
--- llvm/trunk/lib/MC/MCMachOStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCMachOStreamer.cpp Sat Aug 22 14:35:08 2009
@@ -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 @@
 
 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) {





More information about the llvm-commits mailing list